WebPage.addToDirty does not always merge mergeable rects

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 7u6
    • Affects Version/s: 7u6
    • Component/s: javafx
    • None
    • web

      Consider the WebPage.addToDirty method source code:

          private void addToDirty(WCRectangle toPaint) {
              boolean add = true;
              for (int i = 0; i < dirtyRects.size(); i++) {
                  WCRectangle d = dirtyRects.get(i);
                  if (d.contains(toPaint)) {
                      add = false;
                      break;
                  }
                  if (toPaint.contains(d)) {
                      dirtyRects.remove(i);
                      continue;
                  }
                  WCRectangle u = d.createUnion(toPaint);
                  if (u.getIntWidth() * u.getIntHeight() <
                      d.getIntWidth() * d.getIntHeight() + toPaint.getIntWidth() * toPaint.getIntHeight())
                  {
                      dirtyRects.remove(i);
                      toPaint = u;
                      continue;
                  }
              }
              if (add) {
                  dirtyRects.add(toPaint);
              }
          }

      When the second "if" condition is true, the method removes the "current" item, thus making the next item "current", and then, as part of the next iteration, immediately shifts to the next item, effectively skipping the item next to the original "current" item.

      This breaks the merging logic and often causes WebPage to paint the entire page twice during one paint cycle.

            Assignee:
            Anton Tarasov (Inactive)
            Reporter:
            Vasiliy Baranov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: