Changeset 95193 in webkit


Ignore:
Timestamp:
Sep 15, 2011 9:09:59 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Don't bother calculating dirty rect for accelerated 2D canvases.
https://bugs.webkit.org/show_bug.cgi?id=68158

Patch by Andreas Kling <kling@webkit.org> on 2011-09-15
Reviewed by Kenneth Rohde Christiansen.

For accelerated CanvasRenderingContext2D, didDraw() simply calls out
to RenderLayer::contentChanged(). Move this to the top of didDraw()
so we don't waste time calculating a precise dirty rect.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::didDraw):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95192 r95193  
     12011-09-15  Andreas Kling  <kling@webkit.org>
     2
     3        Don't bother calculating dirty rect for accelerated 2D canvases.
     4        https://bugs.webkit.org/show_bug.cgi?id=68158
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        For accelerated CanvasRenderingContext2D, didDraw() simply calls out
     9        to RenderLayer::contentChanged(). Move this to the top of didDraw()
     10        so we don't waste time calculating a precise dirty rect.
     11
     12        * html/canvas/CanvasRenderingContext2D.cpp:
     13        (WebCore::CanvasRenderingContext2D::didDraw):
     14
    1152011-09-15  Brian Salomon  <bsalomon@google.com>
    216
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r95174 r95193  
    16221622        return;
    16231623
     1624#if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
     1625    // If we are drawing to hardware and we have a composited layer, just call contentChanged().
     1626    if (isAccelerated()) {
     1627        RenderBox* renderBox = canvas()->renderBox();
     1628        if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing()) {
     1629            renderBox->layer()->contentChanged(RenderLayer::CanvasChanged);
     1630            return;
     1631        }
     1632    }
     1633#endif
     1634
    16241635    FloatRect dirtyRect = r;
    16251636    if (options & CanvasDidDrawApplyTransform) {
     
    16421653    }
    16431654
    1644 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
    1645     // If we are drawing to hardware and we have a composited layer, just call contentChanged().
    1646     RenderBox* renderBox = canvas()->renderBox();
    1647     if (isAccelerated() && renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
    1648         renderBox->layer()->contentChanged(RenderLayer::CanvasChanged);
    1649     else
    1650 #endif
    1651         canvas()->didDraw(dirtyRect);
     1655    canvas()->didDraw(dirtyRect);
    16521656}
    16531657
Note: See TracChangeset for help on using the changeset viewer.