Changeset 122373 in webkit


Ignore:
Timestamp:
Jul 11, 2012 2:38:43 PM (12 years ago)
Author:
danakj@chromium.org
Message:

[chromium] Rename layerRect to contentRect for rects that live in content space
https://bugs.webkit.org/show_bug.cgi?id=90843

Reviewed by Adrienne Walker.

Source/WebCore:

Dropped the layerTransform() from CCSharedQuadState, as nothing should be
using it to draw with. RenderPasses need a weird drawTransform right now
which was stored in layerTransform, so moved this to the RenderPass quad.

No new tests. No change in behaviour.

  • platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:

(WebCore::CanvasLayerTextureUpdater::paintContents):

  • platform/graphics/chromium/ContentLayerChromium.cpp:

(WebCore::ContentLayerChromium::update):
(WebCore::ContentLayerChromium::needMoreUpdates):

  • platform/graphics/chromium/ImageLayerChromium.cpp:

(WebCore::ImageLayerChromium::update):

  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::visibleContentOpaqueRegion):

  • platform/graphics/chromium/LayerChromium.h:

(WebCore::LayerChromium::visibleContentRect):
(WebCore::LayerChromium::setVisibleContentRect):
(LayerChromium):

  • platform/graphics/chromium/LayerRendererChromium.cpp:

(WebCore::LayerRendererChromium::drawRenderPassQuad):
(WebCore::LayerRendererChromium::drawTileQuad):
(WebCore::LayerRendererChromium::drawYUVVideoQuad):
(WebCore::LayerRendererChromium::drawStreamVideoQuad):
(WebCore::LayerRendererChromium::drawIOSurfaceQuad):

  • platform/graphics/chromium/TiledLayerChromium.cpp:

(WebCore::TiledLayerChromium::updateBounds):
(WebCore::TiledLayerChromium::setNeedsDisplayRect):
(WebCore::TiledLayerChromium::invalidateContentRect):
(WebCore::TiledLayerChromium::updateTiles):
(WebCore::TiledLayerChromium::setTexturePriorities):
(WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
(WebCore::TiledLayerChromium::visibleContentOpaqueRegion):
(WebCore::TiledLayerChromium::updateContentRect):
(WebCore::TiledLayerChromium::needsIdlePaint):
(WebCore::TiledLayerChromium::idlePaintRect):

  • platform/graphics/chromium/TiledLayerChromium.h:

(TiledLayerChromium):

  • platform/graphics/chromium/cc/CCDrawQuad.h:

(WebCore::CCDrawQuad::visibleContentRect):

  • platform/graphics/chromium/cc/CCLayerImpl.cpp:

(WebCore::CCLayerImpl::createSharedQuadState):
(WebCore::CCLayerImpl::appendDebugBorderQuad):
(WebCore::CCLayerImpl::visibleContentOpaqueRegion):

  • platform/graphics/chromium/cc/CCLayerImpl.h:

(WebCore::CCLayerImpl::visibleContentRect):
(WebCore::CCLayerImpl::setVisibleContentRect):
(CCLayerImpl):

  • platform/graphics/chromium/cc/CCLayerTilingData.cpp:

(WebCore::CCLayerTilingData::contentRectToTileIndices):
(WebCore::CCLayerTilingData::opaqueRegionInContentRect):
(WebCore::CCLayerTilingData::setBounds):

  • platform/graphics/chromium/cc/CCLayerTilingData.h:

(CCLayerTilingData):

  • platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:

(WebCore::calculateVisibleContentRect):
(WebCore::layerShouldBeSkipped):
(WebCore):
(WebCore::calculateVisibleAndScissorRectsInternal):

  • platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:

(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):

  • platform/graphics/chromium/cc/CCOcclusionTracker.cpp:

(WebCore::addOcclusionBehindLayer):

  • platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:

(WebCore::CCRenderPassDrawQuad::create):
(WebCore::CCRenderPassDrawQuad::CCRenderPassDrawQuad):

  • platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:

(CCRenderPassDrawQuad):
(WebCore::CCRenderPassDrawQuad::drawTransform):

  • platform/graphics/chromium/cc/CCRenderSurface.cpp:

(WebCore::CCRenderSurface::createSharedQuadState):
(WebCore::CCRenderSurface::createReplicaSharedQuadState):
(WebCore::CCRenderSurface::appendQuads):

  • platform/graphics/chromium/cc/CCSharedQuadState.cpp:

(WebCore::CCSharedQuadState::create):
(WebCore::CCSharedQuadState::CCSharedQuadState):
(WebCore::CCSharedQuadState::isLayerAxisAlignedIntRect):

  • platform/graphics/chromium/cc/CCSharedQuadState.h:

(CCSharedQuadState):
(WebCore::CCSharedQuadState::visibleContentRect):

  • platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:

(WebCore::CCTiledLayerImpl::appendQuads):
(WebCore::CCTiledLayerImpl::visibleContentOpaqueRegion):

Source/WebKit/chromium:

  • tests/CCLayerImplTest.cpp:

(WebCore::TEST):

  • tests/CCLayerTreeHostCommonTest.cpp:
  • tests/CCLayerTreeHostImplTest.cpp:
  • tests/CCOcclusionTrackerTest.cpp:

(WebKitTests::CCOcclusionTrackerTestVisitTargetTwoTimes::runMyTest):
(WebKitTests::CCOcclusionTrackerTestSurfaceRotatedOffAxis::runMyTest):
(WebKitTests::CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect::runMyTest):

  • tests/CCQuadCullerTest.cpp:
  • tests/CCRenderSurfaceTest.cpp:
  • tests/CCSolidColorLayerImplTest.cpp:

(CCLayerTestCommon::TEST):

  • tests/CCTiledLayerImplTest.cpp:

(CCLayerTestCommon::createLayer):
(CCLayerTestCommon::TEST):
(CCLayerTestCommon::getQuads):
(CCLayerTestCommon::coverageVisibleRectIntersectsTiles):
(CCLayerTestCommon::coverageVisibleRectIntersectsBounds):

  • tests/CCTiledLayerTestCommon.cpp:

(WebKitTests::FakeLayerTextureUpdater::prepareToUpdate):
(WebKitTests::FakeTiledLayerChromium::update):

  • tests/CCTiledLayerTestCommon.h:

(FakeTiledLayerChromium):

  • tests/LayerChromiumTest.cpp:
  • tests/TiledLayerChromiumTest.cpp:
Location:
trunk/Source
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122372 r122373  
     12012-07-11  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Rename layerRect to contentRect for rects that live in content space
     4        https://bugs.webkit.org/show_bug.cgi?id=90843
     5
     6        Reviewed by Adrienne Walker.
     7
     8        Dropped the layerTransform() from CCSharedQuadState, as nothing should be
     9        using it to draw with. RenderPasses need a weird drawTransform right now
     10        which was stored in layerTransform, so moved this to the RenderPass quad.
     11
     12        No new tests. No change in behaviour.
     13
     14        * platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
     15        (WebCore::CanvasLayerTextureUpdater::paintContents):
     16        * platform/graphics/chromium/ContentLayerChromium.cpp:
     17        (WebCore::ContentLayerChromium::update):
     18        (WebCore::ContentLayerChromium::needMoreUpdates):
     19        * platform/graphics/chromium/ImageLayerChromium.cpp:
     20        (WebCore::ImageLayerChromium::update):
     21        * platform/graphics/chromium/LayerChromium.cpp:
     22        (WebCore::LayerChromium::visibleContentOpaqueRegion):
     23        * platform/graphics/chromium/LayerChromium.h:
     24        (WebCore::LayerChromium::visibleContentRect):
     25        (WebCore::LayerChromium::setVisibleContentRect):
     26        (LayerChromium):
     27        * platform/graphics/chromium/LayerRendererChromium.cpp:
     28        (WebCore::LayerRendererChromium::drawRenderPassQuad):
     29        (WebCore::LayerRendererChromium::drawTileQuad):
     30        (WebCore::LayerRendererChromium::drawYUVVideoQuad):
     31        (WebCore::LayerRendererChromium::drawStreamVideoQuad):
     32        (WebCore::LayerRendererChromium::drawIOSurfaceQuad):
     33        * platform/graphics/chromium/TiledLayerChromium.cpp:
     34        (WebCore::TiledLayerChromium::updateBounds):
     35        (WebCore::TiledLayerChromium::setNeedsDisplayRect):
     36        (WebCore::TiledLayerChromium::invalidateContentRect):
     37        (WebCore::TiledLayerChromium::updateTiles):
     38        (WebCore::TiledLayerChromium::setTexturePriorities):
     39        (WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
     40        (WebCore::TiledLayerChromium::visibleContentOpaqueRegion):
     41        (WebCore::TiledLayerChromium::updateContentRect):
     42        (WebCore::TiledLayerChromium::needsIdlePaint):
     43        (WebCore::TiledLayerChromium::idlePaintRect):
     44        * platform/graphics/chromium/TiledLayerChromium.h:
     45        (TiledLayerChromium):
     46        * platform/graphics/chromium/cc/CCDrawQuad.h:
     47        (WebCore::CCDrawQuad::visibleContentRect):
     48        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     49        (WebCore::CCLayerImpl::createSharedQuadState):
     50        (WebCore::CCLayerImpl::appendDebugBorderQuad):
     51        (WebCore::CCLayerImpl::visibleContentOpaqueRegion):
     52        * platform/graphics/chromium/cc/CCLayerImpl.h:
     53        (WebCore::CCLayerImpl::visibleContentRect):
     54        (WebCore::CCLayerImpl::setVisibleContentRect):
     55        (CCLayerImpl):
     56        * platform/graphics/chromium/cc/CCLayerTilingData.cpp:
     57        (WebCore::CCLayerTilingData::contentRectToTileIndices):
     58        (WebCore::CCLayerTilingData::opaqueRegionInContentRect):
     59        (WebCore::CCLayerTilingData::setBounds):
     60        * platform/graphics/chromium/cc/CCLayerTilingData.h:
     61        (CCLayerTilingData):
     62        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
     63        (WebCore::calculateVisibleContentRect):
     64        (WebCore::layerShouldBeSkipped):
     65        (WebCore):
     66        (WebCore::calculateVisibleAndScissorRectsInternal):
     67        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
     68        (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
     69        * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
     70        (WebCore::addOcclusionBehindLayer):
     71        * platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
     72        (WebCore::CCRenderPassDrawQuad::create):
     73        (WebCore::CCRenderPassDrawQuad::CCRenderPassDrawQuad):
     74        * platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
     75        (CCRenderPassDrawQuad):
     76        (WebCore::CCRenderPassDrawQuad::drawTransform):
     77        * platform/graphics/chromium/cc/CCRenderSurface.cpp:
     78        (WebCore::CCRenderSurface::createSharedQuadState):
     79        (WebCore::CCRenderSurface::createReplicaSharedQuadState):
     80        (WebCore::CCRenderSurface::appendQuads):
     81        * platform/graphics/chromium/cc/CCSharedQuadState.cpp:
     82        (WebCore::CCSharedQuadState::create):
     83        (WebCore::CCSharedQuadState::CCSharedQuadState):
     84        (WebCore::CCSharedQuadState::isLayerAxisAlignedIntRect):
     85        * platform/graphics/chromium/cc/CCSharedQuadState.h:
     86        (CCSharedQuadState):
     87        (WebCore::CCSharedQuadState::visibleContentRect):
     88        * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
     89        (WebCore::CCTiledLayerImpl::appendQuads):
     90        (WebCore::CCTiledLayerImpl::visibleContentOpaqueRegion):
     91
    1922012-07-11  Chris Fleizach  <cfleizach@apple.com>
    293
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp

    r121628 r122373  
    7676    canvas->restore();
    7777
    78     opaqueLayerRect.scale(contentsWidthScale, contentsHeightScale);
    79     resultingOpaqueRect = enclosedIntRect(opaqueLayerRect);
     78    FloatRect opaqueContentRect = opaqueLayerRect;
     79    opaqueContentRect.scale(contentsWidthScale, contentsHeightScale);
     80    resultingOpaqueRect = enclosedIntRect(opaqueContentRect);
    8081
    8182    m_contentRect = contentRect;
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r122185 r122373  
    9898    createTextureUpdaterIfNeeded();
    9999
    100     IntRect layerRect;
     100    IntRect contentRect;
    101101
    102     // Always call updateLayerRect() but with an empty layer rectangle when
     102    // Always call updateContentRect() but with an empty layer rectangle when
    103103    // layer doesn't draw contents.
    104104    if (drawsContent())
    105         layerRect = visibleLayerRect();
     105        contentRect = visibleContentRect();
    106106
    107     updateLayerRect(updater, layerRect, occlusion);
     107    updateContentRect(updater, contentRect, occlusion);
    108108    m_needsDisplay = false;
    109109}
     
    113113    if (!drawsContent())
    114114        return false;
    115     return needsIdlePaint(visibleLayerRect());
     115    return needsIdlePaint(visibleContentRect());
    116116}
    117117
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r121574 r122373  
    156156        m_textureUpdater->setBitmap(m_bitmap);
    157157        updateTileSizeAndTilingOption();
    158         invalidateRect(IntRect(IntPoint(), contentBounds()));
     158        invalidateContentRect(IntRect(IntPoint(), contentBounds()));
    159159        m_needsDisplay = false;
    160160    }
    161161
    162     updateLayerRect(updater, visibleLayerRect(), occlusion);
     162    updateContentRect(updater, visibleContentRect(), occlusion);
    163163}
    164164
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r121396 r122373  
    733733{
    734734    if (opaque())
    735         return visibleLayerRect();
     735        return visibleContentRect();
    736736    return Region();
    737737}
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r122185 r122373  
    155155    bool transformIsAnimating() const;
    156156
    157     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
    158     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
     157    const IntRect& visibleContentRect() const { return m_visibleContentRect; }
     158    void setVisibleContentRect(const IntRect& visibleContentRect) { m_visibleContentRect = visibleContentRect; }
    159159
    160160    const IntRect& scissorRect() const { return m_scissorRect; }
     
    345345
    346346    // Uses layer's content space.
    347     IntRect m_visibleLayerRect;
     347    IntRect m_visibleContentRect;
    348348
    349349    // During drawing, identifies the region outside of which nothing should be drawn.
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r122306 r122373  
    611611        return;
    612612
    613     WebTransformationMatrix renderTransform = quad->layerTransform();
     613    WebTransformationMatrix renderTransform = quad->drawTransform();
    614614    // Apply a scaling factor to size the quad from 1x1 to its intended size.
    615615    renderTransform.scale3d(quad->quadRect().width(), quad->quadRect().height(), 1);
     
    634634    if (backgroundTexture) {
    635635        ASSERT(backgroundTexture->size() == quad->quadRect().size());
    636         copyTextureToFramebuffer(backgroundTexture->id(), quad->quadRect().size(), quad->layerTransform());
     636        copyTextureToFramebuffer(backgroundTexture->id(), quad->quadRect().size(), quad->drawTransform());
    637637    }
    638638
     
    716716    ASSERT(!clipped);
    717717
    718     drawTexturedQuad(quad->layerTransform(), quad->quadRect().width(), quad->quadRect().height(), quad->opacity(), surfaceQuad,
     718    drawTexturedQuad(quad->drawTransform(), quad->quadRect().width(), quad->quadRect().height(), quad->opacity(), surfaceQuad,
    719719                     shaderMatrixLocation, shaderAlphaLocation, shaderQuadLocation);
    720720}
     
    808808
    809809    bool clipped = false;
    810     FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(quad->layerRect()), clipped);
     810    FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(quad->visibleContentRect()), clipped);
    811811    ASSERT(!clipped);
    812812
     
    969969    GLC(context(), context()->uniform3fv(program->fragmentShader().yuvAdjLocation(), 1, yuvAdjust));
    970970
    971     const IntSize& bounds = quad->quadRect().size();
    972     drawTexturedQuad(quad->layerTransform(), bounds.width(), bounds.height(), quad->opacity(), FloatQuad(),
    973                                     program->vertexShader().matrixLocation(),
    974                                     program->fragmentShader().alphaLocation(),
    975                                     -1);
     971    WebTransformationMatrix quadTransform = quad->quadTransform();
     972    IntRect quadRect = quad->quadRect();
     973    quadTransform.translate(quadRect.x() + quadRect.width() / 2.0, quadRect.y() + quadRect.height() / 2.0);
     974
     975    drawTexturedQuad(quadTransform, quadRect.width(), quadRect.height(), quad->opacity(), FloatQuad(),
     976                     program->vertexShader().matrixLocation(), program->fragmentShader().alphaLocation(), -1);
    976977
    977978    // Reset active texture back to texture 0.
     
    996997    GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocation(), 0));
    997998
    998     const IntSize& bounds = quad->quadRect().size();
    999     drawTexturedQuad(quad->layerTransform(), bounds.width(), bounds.height(), quad->opacity(), sharedGeometryQuad(),
    1000                      program->vertexShader().matrixLocation(),
    1001                      program->fragmentShader().alphaLocation(),
    1002                      -1);
     999    WebTransformationMatrix quadTransform = quad->quadTransform();
     1000    IntRect quadRect = quad->quadRect();
     1001    quadTransform.translate(quadRect.x() + quadRect.width() / 2.0, quadRect.y() + quadRect.height() / 2.0);
     1002
     1003    drawTexturedQuad(quadTransform, quadRect.width(), quadRect.height(), quad->opacity(), sharedGeometryQuad(),
     1004                     program->vertexShader().matrixLocation(), program->fragmentShader().alphaLocation(), -1);
    10031005}
    10041006
     
    10931095    GLC(context(), context()->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
    10941096
    1095     const IntSize& bounds = quad->quadRect().size();
    1096 
    1097     drawTexturedQuad(quad->layerTransform(), bounds.width(), bounds.height(), quad->opacity(), sharedGeometryQuad(), binding.matrixLocation, binding.alphaLocation, -1);
     1097    WebTransformationMatrix quadTransform = quad->quadTransform();
     1098    IntRect quadRect = quad->quadRect();
     1099    quadTransform.translate(quadRect.x() + quadRect.width() / 2.0, quadRect.y() + quadRect.height() / 2.0);
     1100
     1101    drawTexturedQuad(quadTransform, quadRect.width(), quadRect.height(), quad->opacity(), sharedGeometryQuad(), binding.matrixLocation, binding.alphaLocation, -1);
    10981102
    10991103    GLC(context(), context()->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, 0));
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r122294 r122373  
    157157    Vector<IntRect> rects = newRegion.rects();
    158158    for (size_t i = 0; i < rects.size(); ++i)
    159         invalidateRect(rects[i]);
     159        invalidateContentRect(rects[i]);
    160160}
    161161
     
    289289    scaledDirtyRect.scale(contentsWidthScale, contentsHeightScale);
    290290    IntRect dirty = enclosingIntRect(scaledDirtyRect);
    291     invalidateRect(dirty);
     291    invalidateContentRect(dirty);
    292292    LayerChromium::setNeedsDisplayRect(dirtyRect);
    293293}
     
    307307}
    308308
    309 void TiledLayerChromium::invalidateRect(const IntRect& layerRect)
     309void TiledLayerChromium::invalidateContentRect(const IntRect& contentRect)
    310310{
    311311    updateBounds();
    312     if (m_tiler->isEmpty() || layerRect.isEmpty() || m_skipsDraw)
     312    if (m_tiler->isEmpty() || contentRect.isEmpty() || m_skipsDraw)
    313313        return;
    314314
     
    320320            continue;
    321321        IntRect bound = m_tiler->tileRect(tile);
    322         bound.intersect(layerRect);
     322        bound.intersect(contentRect);
    323323        tile->dirtyRect.unite(bound);
    324324    }
     
    357357    // the dirty regions currently being drawn. All dirty tiles that are to be painted
    358358    // get their updateRect set to dirtyRect and dirtyRect cleared. This way if
    359     // invalidateRect is invoked during updateLayerRect we don't lose the request.
     359    // invalidateContentRect is invoked during updateContentRect we don't lose the request.
    360360    IntRect paintRect;
    361361    for (int j = top; j <= bottom; ++j) {
     
    378378            // If any part of the tile is visible, then we need to update it so the tile is pushed to the impl thread.
    379379            if (!idle && occlusion) {
    380                 IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleLayerRect());
     380                IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleContentRect());
    381381                if (occlusion->occluded(this, visibleTileRect)) {
    382382                    ASSERT(!tile->updated);
     
    518518void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priorityCalc)
    519519{
    520     setTexturePrioritiesInRect(priorityCalc, visibleLayerRect());
    521 }
    522 
    523 void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visibleRect)
     520    setTexturePrioritiesInRect(priorityCalc, visibleContentRect());
     521}
     522
     523void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visibleContentRect)
    524524{
    525525    updateBounds();
    526526    resetUpdateState();
    527527
    528     IntRect prepaintRect = idlePaintRect(visibleRect);
     528    IntRect prepaintRect = idlePaintRect(visibleContentRect);
    529529    bool drawsToRootSurface = !targetRenderSurface()->targetRenderSurface();
    530530
     
    532532    if (!prepaintRect.isEmpty()) {
    533533        int left, top, right, bottom;
    534         m_tiler->layerRectToTileIndices(prepaintRect, left, top, right, bottom);
     534        m_tiler->contentRectToTileIndices(prepaintRect, left, top, right, bottom);
    535535        for (int j = top; j <= bottom; ++j)
    536536            for (int i = left; i <= right; ++i)
     
    543543    // uploaded, swapped atomically via pushProperties, and finally deleted
    544544    // after the commit is complete, after which they can be recycled.
    545     if (!visibleRect.isEmpty()) {
     545    if (!visibleContentRect.isEmpty()) {
    546546        int left, top, right, bottom;
    547         m_tiler->layerRectToTileIndices(visibleRect, left, top, right, bottom);
     547        m_tiler->contentRectToTileIndices(visibleContentRect, left, top, right, bottom);
    548548        for (int j = top; j <= bottom; ++j) {
    549549            for (int i = left; i <= right; ++i) {
     
    582582        // 512 pixels of pre-painting. Later we can just pass an animating flag etc. to the
    583583        // calculator and it can take care of this special case if we still need it.
    584         if (visibleRect.isEmpty() && !prepaintRect.isEmpty())
     584        if (visibleContentRect.isEmpty() && !prepaintRect.isEmpty())
    585585            tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(512, drawsToRootSurface));
    586         else if (!visibleRect.isEmpty())
    587             tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(visibleRect, tileRect, drawsToRootSurface));
     586        else if (!visibleContentRect.isEmpty())
     587            tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(visibleContentRect, tileRect, drawsToRootSurface));
    588588    }
    589589}
     
    594594        return Region();
    595595    if (opaque())
    596         return visibleLayerRect();
    597     return m_tiler->opaqueRegionInLayerRect(visibleLayerRect());
     596        return visibleContentRect();
     597    return m_tiler->opaqueRegionInContentRect(visibleContentRect());
    598598}
    599599
     
    612612}
    613613
    614 void TiledLayerChromium::updateLayerRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion)
     614void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion)
    615615{
    616616    m_skipsDraw = false;
     
    626626    if (!contentRect.isEmpty()) {
    627627        int left, top, right, bottom;
    628         m_tiler->layerRectToTileIndices(contentRect, left, top, right, bottom);
     628        m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
    629629        updateTiles(false, left, top, right, bottom, updater, occlusion);
    630630    }
     
    640640
    641641    int prepaintLeft, prepaintTop, prepaintRight, prepaintBottom;
    642     m_tiler->layerRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom);
     642    m_tiler->contentRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom);
    643643
    644644    // If the layer is not visible, we have nothing to expand from, so instead we prepaint the outer-most set of tiles.
     
    658658
    659659    int left, top, right, bottom;
    660     m_tiler->layerRectToTileIndices(contentRect, left, top, right, bottom);
     660    m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
    661661
    662662    // Otherwise, prepaint anything that was occluded but inside the layer's visible region.
     
    694694}
    695695
    696 bool TiledLayerChromium::needsIdlePaint(const IntRect& contentRect)
     696bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect)
    697697{
    698698    if (m_skipsIdlePaint)
     
    702702        return false;
    703703
    704     IntRect idlePaintContentRect = idlePaintRect(contentRect);
     704    IntRect idlePaintContentRect = idlePaintRect(visibleContentRect);
    705705    if (idlePaintContentRect.isEmpty())
    706706        return false;
    707707
    708708    int left, top, right, bottom;
    709     m_tiler->layerRectToTileIndices(idlePaintContentRect, left, top, right, bottom);
     709    m_tiler->contentRectToTileIndices(idlePaintContentRect, left, top, right, bottom);
    710710
    711711    for (int j = top; j <= bottom; ++j) {
    712712        for (int i = left; i <= right; ++i) {
    713             // If the layerRect is empty, then we are painting the outer-most set of tiles only.
    714             if (contentRect.isEmpty() && i != left && i != right && j != top && j != bottom)
     713            // If the visibleContentRect is empty, then we are painting the outer-most set of tiles only.
     714            if (visibleContentRect.isEmpty() && i != left && i != right && j != top && j != bottom)
    715715                continue;
    716716            UpdatableTile* tile = tileAt(i, j);
     
    729729}
    730730
    731 IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleRect)
     731IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleContentRect)
    732732{
    733733    IntRect contentRect(IntPoint::zero(), contentBounds());
     
    736736    // of them is going to become visible. For small layers we return the entire layer, for larger
    737737    // ones we avoid prepainting the layer at all.
    738     if (visibleRect.isEmpty()) {
     738    if (visibleContentRect.isEmpty()) {
    739739        bool isSmallLayer = m_tiler->numTilesX() <= 9 && m_tiler->numTilesY() <= 9 && m_tiler->numTilesX() * m_tiler->numTilesY() <= 9;
    740740        if ((drawTransformIsAnimating() || screenSpaceTransformIsAnimating()) && isSmallLayer)
     
    745745    // FIXME: This can be made a lot larger now! We should increase
    746746    //        this slowly while insuring it doesn't cause any perf issues.
    747     IntRect prepaintRect = visibleRect;
     747    IntRect prepaintRect = visibleContentRect;
    748748    prepaintRect.inflateX(m_tiler->tileSize().width());
    749749    prepaintRect.inflateY(m_tiler->tileSize().height() * 2);
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h

    r122185 r122373  
    7878
    7979    // Set invalidations to be potentially repainted during update().
    80     void invalidateRect(const IntRect& layerRect);
     80    void invalidateContentRect(const IntRect& contentRect);
    8181
    8282    // Reset state on tiles that will be used for updating the layer.
    8383    void resetUpdateState();
    8484
    85     // Prepare data needed to update textures that intersect with layerRect.
    86     void updateLayerRect(CCTextureUpdater&, const IntRect& layerRect, const CCOcclusionTracker*);
     85    // Prepare data needed to update textures that intersect with contentRect.
     86    void updateContentRect(CCTextureUpdater&, const IntRect& contentRect, const CCOcclusionTracker*);
    8787
    8888    // After preparing an update, returns true if more painting is needed.
    89     bool needsIdlePaint(const IntRect& layerRect);
     89    bool needsIdlePaint(const IntRect& visibleContentRect);
    9090
    91     IntRect idlePaintRect(const IntRect& visibleLayerRect);
     91    IntRect idlePaintRect(const IntRect& visibleContentRect);
    9292
    9393    bool skipsDraw() const { return m_skipsDraw; }
     
    105105    bool tileNeedsBufferedUpdate(UpdatableTile*);
    106106
    107     void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleLayerRect);
     107    void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleContentRect);
    108108
    109109    void updateTiles(bool idle, int left, int top, int right, int bottom, CCTextureUpdater&, const CCOcclusionTracker*);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.h

    r120457 r122373  
    5050    const IntRect& quadRect() const { return m_quadRect; }
    5151    const WebKit::WebTransformationMatrix& quadTransform() const { return m_sharedQuadState->quadTransform(); }
    52     const WebKit::WebTransformationMatrix& layerTransform() const { return m_sharedQuadState->layerTransform(); }
    53     const IntRect& layerRect() const { return m_sharedQuadState->layerRect(); }
     52    const IntRect& visibleContentRect() const { return m_sharedQuadState->visibleContentRect(); }
    5453    const IntRect& scissorRect() const { return m_sharedQuadState->scissorRect(); }
    5554    float opacity() const { return m_sharedQuadState->opacity(); }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r122160 r122373  
    148148PassOwnPtr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const
    149149{
    150     return CCSharedQuadState::create(quadTransform(), drawTransform(), visibleLayerRect(), m_scissorRect, drawOpacity(), opaque());
     150    return CCSharedQuadState::create(quadTransform(), m_visibleContentRect, m_scissorRect, m_drawOpacity, m_opaque);
    151151}
    152152
     
    173173        return;
    174174
    175     IntRect layerRect(IntPoint(), contentBounds());
    176     quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, layerRect, debugBorderColor(), debugBorderWidth()));
     175    IntRect contentRect(IntPoint(), contentBounds());
     176    quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, contentRect, debugBorderColor(), debugBorderWidth()));
    177177}
    178178
     
    614614{
    615615    if (opaque())
    616         return visibleLayerRect();
     616        return visibleContentRect();
    617617    return Region();
    618618}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h

    r121396 r122373  
    228228    CCInputHandlerClient::ScrollStatus tryScroll(const IntPoint& viewportPoint, CCInputHandlerClient::ScrollInputType) const;
    229229
    230     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
    231     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
     230    const IntRect& visibleContentRect() const { return m_visibleContentRect; }
     231    void setVisibleContentRect(const IntRect& visibleContentRect) { m_visibleContentRect = visibleContentRect; }
    232232
    233233    bool doubleSided() const { return m_doubleSided; }
     
    333333
    334334    // Uses layer's content space.
    335     IntRect m_visibleLayerRect;
     335    IntRect m_visibleContentRect;
    336336    bool m_masksToBounds;
    337337    bool m_opaque;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp

    r116359 r122373  
    100100}
    101101
    102 void CCLayerTilingData::layerRectToTileIndices(const IntRect& layerRect, int& left, int& top, int& right, int& bottom) const
     102void CCLayerTilingData::contentRectToTileIndices(const IntRect& contentRect, int& left, int& top, int& right, int& bottom) const
    103103{
    104     left = m_tilingData.tileXIndexFromSrcCoord(layerRect.x());
    105     top = m_tilingData.tileYIndexFromSrcCoord(layerRect.y());
    106     right = m_tilingData.tileXIndexFromSrcCoord(layerRect.maxX() - 1);
    107     bottom = m_tilingData.tileYIndexFromSrcCoord(layerRect.maxY() - 1);
     104    left = m_tilingData.tileXIndexFromSrcCoord(contentRect.x());
     105    top = m_tilingData.tileYIndexFromSrcCoord(contentRect.y());
     106    right = m_tilingData.tileXIndexFromSrcCoord(contentRect.maxX() - 1);
     107    bottom = m_tilingData.tileYIndexFromSrcCoord(contentRect.maxY() - 1);
    108108}
    109109
     
    115115}
    116116
    117 Region CCLayerTilingData::opaqueRegionInLayerRect(const IntRect& layerRect) const
     117Region CCLayerTilingData::opaqueRegionInContentRect(const IntRect& contentRect) const
    118118{
    119     if (layerRect.isEmpty())
     119    if (contentRect.isEmpty())
    120120        return Region();
    121121
    122122    Region opaqueRegion;
    123123    int left, top, right, bottom;
    124     layerRectToTileIndices(layerRect, left, top, right, bottom);
     124    contentRectToTileIndices(contentRect, left, top, right, bottom);
    125125    for (int j = top; j <= bottom; ++j) {
    126126        for (int i = left; i <= right; ++i) {
     
    129129                continue;
    130130
    131             IntRect tileOpaqueRect = intersection(layerRect, tile->opaqueRect());
     131            IntRect tileOpaqueRect = intersection(contentRect, tile->opaqueRect());
    132132            opaqueRegion.unite(tileOpaqueRect);
    133133        }
     
    142142    // Any tiles completely outside our new bounds are invalid and should be dropped.
    143143    int left, top, right, bottom;
    144     layerRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom);
     144    contentRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom);
    145145    Vector<TileMapKey> invalidTileKeys;
    146146    for (TileMap::const_iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) {
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h

    r116359 r122373  
    9999    IntSize bounds() const;
    100100
    101     void layerRectToTileIndices(const IntRect&, int &left, int &top, int &right, int &bottom) const;
     101    void contentRectToTileIndices(const IntRect&, int &left, int &top, int &right, int &bottom) const;
    102102    IntRect tileRect(const Tile*) const;
    103103
    104     Region opaqueRegionInLayerRect(const IntRect&) const;
     104    Region opaqueRegionInContentRect(const IntRect&) const;
    105105
    106106    void reset();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp

    r122120 r122373  
    154154
    155155template<typename LayerType>
    156 static IntRect calculateVisibleLayerRect(LayerType* layer)
     156static IntRect calculateVisibleContentRect(LayerType* layer)
    157157{
    158158    ASSERT(layer->targetRenderSurface());
     
    177177    transform.translate(-contentBounds.width() / 2.0, -contentBounds.height() / 2.0);
    178178
    179     IntRect visibleLayerRect = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerBoundRect, transform);
    180     return visibleLayerRect;
     179    IntRect visibleContentRect = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerBoundRect, transform);
     180    return visibleContentRect;
    181181}
    182182
     
    220220    // Some additional conditions need to be computed at a later point after the recursion is finished.
    221221    //   - the intersection of render surface content and layer clipRect is empty
    222     //   - the visibleLayerRect is empty
     222    //   - the visibleContentRect is empty
    223223    //
    224224    // Note, if the layer should not have been drawn due to being fully transparent,
     
    834834
    835835// FIXME: Instead of using the following function to set visibility rects on a second
    836 // tree pass, revise calculateVisibleLayerRect() so that this can be done in a single
     836// tree pass, revise calculateVisibleContentRect() so that this can be done in a single
    837837// pass inside calculateDrawTransformsInternal<>().
    838838template<typename LayerType, typename LayerList, typename RenderSurfaceType>
     
    847847            LayerType* maskLayer = it->maskLayer();
    848848            if (maskLayer)
    849                 maskLayer->setVisibleLayerRect(IntRect(IntPoint(), it->contentBounds()));
     849                maskLayer->setVisibleContentRect(IntRect(IntPoint(), it->contentBounds()));
    850850            LayerType* replicaMaskLayer = it->replicaLayer() ? it->replicaLayer()->maskLayer() : 0;
    851851            if (replicaMaskLayer)
    852                 replicaMaskLayer->setVisibleLayerRect(IntRect(IntPoint(), it->contentBounds()));
     852                replicaMaskLayer->setVisibleContentRect(IntRect(IntPoint(), it->contentBounds()));
    853853        } else if (it.representsItself()) {
    854             IntRect visibleLayerRect = calculateVisibleLayerRect(*it);
    855             it->setVisibleLayerRect(visibleLayerRect);
     854            IntRect visibleContentRect = calculateVisibleContentRect(*it);
     855            it->setVisibleContentRect(visibleContentRect);
    856856
    857857            IntRect scissorRect = calculateLayerScissorRect<LayerType, RenderSurfaceType>(*it, rootScissorRect);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

    r122360 r122373  
    330330            CCRenderPass* contributingRenderPass = surfacePassMap.get(it->renderSurface());
    331331            pass->appendQuadsForRenderSurfaceLayer(*it, contributingRenderPass, &occlusionTracker);
    332         } else if (it.representsItself() && !occlusionTracker.occluded(*it, it->visibleLayerRect()) && !it->visibleLayerRect().isEmpty() && !it->scissorRect().isEmpty()) {
     332        } else if (it.representsItself() && !occlusionTracker.occluded(*it, it->visibleContentRect()) && !it->visibleContentRect().isEmpty() && !it->scissorRect().isEmpty()) {
    333333            it->willDraw(m_layerRenderer.get(), context());
    334334            frame.willDrawLayers.append(*it);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp

    r121583 r122373  
    311311static inline void addOcclusionBehindLayer(Region& region, const LayerType* layer, const WebTransformationMatrix& transform, const Region& opaqueContents, const IntRect& scissorRect, const IntSize& minimumTrackingSize, Vector<IntRect>* occludingScreenSpaceRects)
    312312{
    313     ASSERT(layer->visibleLayerRect().contains(opaqueContents.bounds()));
     313    ASSERT(layer->visibleContentRect().contains(opaqueContents.bounds()));
    314314
    315315    bool clipped;
    316     FloatQuad visibleTransformedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleLayerRect()), clipped);
     316    FloatQuad visibleTransformedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleContentRect()), clipped);
    317317    // FIXME: Find a rect interior to each transformed quad.
    318318    if (clipped || !visibleTransformedQuad.isRectilinear())
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp

    r122160 r122373  
    3232namespace WebCore {
    3333
    34 PassOwnPtr<CCRenderPassDrawQuad> CCRenderPassDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)
     34PassOwnPtr<CCRenderPassDrawQuad> CCRenderPassDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::WebTransformationMatrix& drawTransform, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)
    3535{
    36     return adoptPtr(new CCRenderPassDrawQuad(sharedQuadState, quadRect, renderPass, isReplica, filters, backgroundFilters, maskTextureId, contentsChangedSinceLastFrame));
     36    return adoptPtr(new CCRenderPassDrawQuad(sharedQuadState, quadRect, renderPass, isReplica, drawTransform, filters, backgroundFilters, maskTextureId, contentsChangedSinceLastFrame));
    3737}
    3838
    39 CCRenderPassDrawQuad::CCRenderPassDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)
     39CCRenderPassDrawQuad::CCRenderPassDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::WebTransformationMatrix& drawTransform, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)
    4040    : CCDrawQuad(sharedQuadState, CCDrawQuad::RenderPass, quadRect)
    4141    , m_renderPass(renderPass)
    4242    , m_renderPassId(renderPass->id())
    4343    , m_isReplica(isReplica)
     44    , m_drawTransform(drawTransform)
    4445    , m_filters(filters)
    4546    , m_backgroundFilters(backgroundFilters)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h

    r122160 r122373  
    2929#include "cc/CCDrawQuad.h"
    3030#include <public/WebFilterOperations.h>
     31#include <public/WebTransformationMatrix.h>
    3132#include <wtf/PassOwnPtr.h>
    3233
     
    3839    WTF_MAKE_NONCOPYABLE(CCRenderPassDrawQuad);
    3940public:
    40     static PassOwnPtr<CCRenderPassDrawQuad> create(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame);
     41    static PassOwnPtr<CCRenderPassDrawQuad> create(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::WebTransformationMatrix&, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame);
    4142
    4243    const CCRenderPass* renderPass() const { return m_renderPass; }
     
    4647    const IntRect& contentsChangedSinceLastFrame() const { return m_contentsChangedSinceLastFrame; }
    4748
     49    // FIXME: This should be removed and we should draw the RenderPass with the quadTransform.
     50    const WebKit::WebTransformationMatrix& drawTransform() const { return m_drawTransform; }
     51
    4852    const WebKit::WebFilterOperations& filters() const { return m_filters; }
    4953    const WebKit::WebFilterOperations& backgroundFilters() const { return m_backgroundFilters; }
    5054
    5155private:
    52     CCRenderPassDrawQuad(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame);
     56    CCRenderPassDrawQuad(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::WebTransformationMatrix&, const WebKit::WebFilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame);
    5357
    5458    const CCRenderPass* m_renderPass;
    5559    int m_renderPassId;
    5660    bool m_isReplica;
     61    WebKit::WebTransformationMatrix m_drawTransform;
    5762    WebKit::WebFilterOperations m_filters;
    5863    WebKit::WebFilterOperations m_backgroundFilters;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp

    r122160 r122373  
    189189{
    190190    bool isOpaque = false;
    191     return CCSharedQuadState::create(originTransform(), drawTransform(), contentRect(), m_scissorRect, drawOpacity(), isOpaque);
     191    return CCSharedQuadState::create(m_originTransform, m_contentRect, m_scissorRect, m_drawOpacity, isOpaque);
    192192}
    193193
     
    195195{
    196196    bool isOpaque = false;
    197     return CCSharedQuadState::create(replicaOriginTransform(), replicaDrawTransform(), contentRect(), m_scissorRect, drawOpacity(), isOpaque);
     197    return CCSharedQuadState::create(m_replicaOriginTransform, m_contentRect, m_scissorRect, m_drawOpacity, isOpaque);
    198198}
    199199
     
    233233
    234234    int maskTextureId = maskLayer ? maskLayer->contentsTextureId() : 0;
     235    WebTransformationMatrix drawTransform = forReplica ? m_replicaDrawTransform : m_drawTransform;
    235236    IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : IntRect();
    236237
    237     quadList.appendSurface(CCRenderPassDrawQuad::create(sharedQuadState, contentRect(), renderPass, forReplica, filters(), backgroundFilters(), maskTextureId, contentsChangedSinceLastFrame));
     238    quadList.appendSurface(CCRenderPassDrawQuad::create(sharedQuadState, contentRect(), renderPass, forReplica, drawTransform, filters(), backgroundFilters(), maskTextureId, contentsChangedSinceLastFrame));
    238239}
    239240
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp

    r121583 r122373  
    3434namespace WebCore {
    3535
    36 PassOwnPtr<CCSharedQuadState> CCSharedQuadState::create(const WebTransformationMatrix& quadTransform, const WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque)
     36PassOwnPtr<CCSharedQuadState> CCSharedQuadState::create(const WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque)
    3737{
    38     return adoptPtr(new CCSharedQuadState(quadTransform, layerTransform, layerRect, scissorRect, opacity, opaque));
     38    return adoptPtr(new CCSharedQuadState(quadTransform, visibleContentRect, scissorRect, opacity, opaque));
    3939}
    4040
    41 CCSharedQuadState::CCSharedQuadState(const WebTransformationMatrix& quadTransform, const WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque)
     41CCSharedQuadState::CCSharedQuadState(const WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque)
    4242    : m_quadTransform(quadTransform)
    43     , m_layerTransform(layerTransform)
    44     , m_layerRect(layerRect)
     43    , m_visibleContentRect(visibleContentRect)
    4544    , m_scissorRect(scissorRect)
    4645    , m_opacity(opacity)
     
    5453    // Assume that they're orthonormal and have integer scales and translations.
    5554    bool clipped = false;
    56     FloatQuad quad = CCMathUtil::mapQuad(quadTransform(), FloatQuad(layerRect()), clipped);
     55    FloatQuad quad = CCMathUtil::mapQuad(quadTransform(), FloatQuad(visibleContentRect()), clipped);
    5756    return !clipped && quad.isRectilinear() && quad.boundingBox().isExpressibleAsIntRect();
    5857}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.h

    r119401 r122373  
    3737    WTF_MAKE_NONCOPYABLE(CCSharedQuadState);
    3838public:
    39     static PassOwnPtr<CCSharedQuadState> create(const WebKit::WebTransformationMatrix& quadTransform, const WebKit::WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque);
     39    static PassOwnPtr<CCSharedQuadState> create(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque);
    4040
    41     // The transform that quads in a CCDrawQuad should be transformed with.
     41    // Transforms from content space for the quad to the quad's target content space.
    4242    const WebKit::WebTransformationMatrix& quadTransform() const { return m_quadTransform; }
    43     // The transform that layerRect() should be transformed with.
    44     const WebKit::WebTransformationMatrix& layerTransform() const { return m_layerTransform; }
    45     const IntRect& layerRect() const { return m_layerRect; }
     43    // This rect lives in the content space for the quad's originating layer.
     44    const IntRect& visibleContentRect() const { return m_visibleContentRect; }
     45    // This rect lives in the quad's target content space.
    4646    const IntRect& scissorRect() const { return m_scissorRect; }
    4747
     
    5151
    5252private:
    53     CCSharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const WebKit::WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque);
     53    CCSharedQuadState(const WebKit::WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque);
    5454
    5555    WebKit::WebTransformationMatrix m_quadTransform;
    56     WebKit::WebTransformationMatrix m_layerTransform;
    57     IntRect m_layerRect;
     56    IntRect m_visibleContentRect;
    5857    IntRect m_scissorRect;
    5958    float m_opacity;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp

    r122160 r122373  
    143143void CCTiledLayerImpl::appendQuads(CCQuadCuller& quadList, const CCSharedQuadState* sharedQuadState, bool& hadMissingTiles)
    144144{
    145     const IntRect& layerRect = visibleLayerRect();
    146 
    147     if (!m_tiler || m_tiler->hasEmptyBounds() || layerRect.isEmpty())
     145    const IntRect& contentRect = visibleContentRect();
     146
     147    if (!m_tiler || m_tiler->hasEmptyBounds() || contentRect.isEmpty())
    148148        return;
    149149
    150150    int left, top, right, bottom;
    151     m_tiler->layerRectToTileIndices(layerRect, left, top, right, bottom);
     151    m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom);
    152152
    153153    if (hasDebugBorders()) {
     
    175175            IntRect tileRect = m_tiler->tileBounds(i, j);
    176176            IntRect displayRect = tileRect;
    177             tileRect.intersect(layerRect);
     177            tileRect.intersect(contentRect);
    178178
    179179            // Skip empty tiles.
     
    190190
    191191            IntRect tileOpaqueRect = tile->opaqueRect();
    192             tileOpaqueRect.intersect(layerRect);
     192            tileOpaqueRect.intersect(contentRect);
    193193
    194194            // Keep track of how the top left has moved, so the texture can be
     
    236236        return Region();
    237237    if (opaque())
    238         return visibleLayerRect();
    239     return m_tiler->opaqueRegionInLayerRect(visibleLayerRect());
     238        return visibleContentRect();
     239    return m_tiler->opaqueRegionInContentRect(visibleContentRect());
    240240}
    241241
  • trunk/Source/WebKit/chromium/ChangeLog

    r122360 r122373  
     12012-07-11  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Rename layerRect to contentRect for rects that live in content space
     4        https://bugs.webkit.org/show_bug.cgi?id=90843
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * tests/CCLayerImplTest.cpp:
     9        (WebCore::TEST):
     10        * tests/CCLayerTreeHostCommonTest.cpp:
     11        * tests/CCLayerTreeHostImplTest.cpp:
     12        * tests/CCOcclusionTrackerTest.cpp:
     13        (WebKitTests::CCOcclusionTrackerTestVisitTargetTwoTimes::runMyTest):
     14        (WebKitTests::CCOcclusionTrackerTestSurfaceRotatedOffAxis::runMyTest):
     15        (WebKitTests::CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect::runMyTest):
     16        * tests/CCQuadCullerTest.cpp:
     17        * tests/CCRenderSurfaceTest.cpp:
     18        * tests/CCSolidColorLayerImplTest.cpp:
     19        (CCLayerTestCommon::TEST):
     20        * tests/CCTiledLayerImplTest.cpp:
     21        (CCLayerTestCommon::createLayer):
     22        (CCLayerTestCommon::TEST):
     23        (CCLayerTestCommon::getQuads):
     24        (CCLayerTestCommon::coverageVisibleRectIntersectsTiles):
     25        (CCLayerTestCommon::coverageVisibleRectIntersectsBounds):
     26        * tests/CCTiledLayerTestCommon.cpp:
     27        (WebKitTests::FakeLayerTextureUpdater::prepareToUpdate):
     28        (WebKitTests::FakeTiledLayerChromium::update):
     29        * tests/CCTiledLayerTestCommon.h:
     30        (FakeTiledLayerChromium):
     31        * tests/LayerChromiumTest.cpp:
     32        * tests/TiledLayerChromiumTest.cpp:
     33
    1342012-07-11  Dana Jansens  <danakj@chromium.org>
    235
  • trunk/Source/WebKit/chromium/tests/CCLayerImplTest.cpp

    r121396 r122373  
    176176    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawableContentRect(arbitraryIntRect));
    177177    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setUpdateRect(arbitraryFloatRect));
    178     EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisibleLayerRect(arbitraryIntRect));
     178    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisibleContentRect(arbitraryIntRect));
    179179    EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMaxScrollPosition(arbitraryIntSize));
    180180}
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp

    r122120 r122373  
    28452845    EXPECT_EQ(childOfAnimatingSurface->id(), renderSurfaceLayerList[1]->renderSurface()->layerList()[1]->id());
    28462846
    2847     EXPECT_FALSE(child2->visibleLayerRect().isEmpty());
    2848 
    2849     // The animating layers should have a visibleLayerRect that represents the area of the front face that is within the viewport.
    2850     EXPECT_EQ(animatingChild->visibleLayerRect(), IntRect(IntPoint(), animatingChild->contentBounds()));
    2851     EXPECT_EQ(animatingSurface->visibleLayerRect(), IntRect(IntPoint(), animatingSurface->contentBounds()));
    2852     // And layers in the subtree of the animating layer should have valid visibleLayerRects also.
    2853     EXPECT_EQ(childOfAnimatingSurface->visibleLayerRect(), IntRect(IntPoint(), childOfAnimatingSurface->contentBounds()));
     2847    EXPECT_FALSE(child2->visibleContentRect().isEmpty());
     2848
     2849    // The animating layers should have a visibleContentRect that represents the area of the front face that is within the viewport.
     2850    EXPECT_EQ(animatingChild->visibleContentRect(), IntRect(IntPoint(), animatingChild->contentBounds()));
     2851    EXPECT_EQ(animatingSurface->visibleContentRect(), IntRect(IntPoint(), animatingSurface->contentBounds()));
     2852    // And layers in the subtree of the animating layer should have valid visibleContentRects also.
     2853    EXPECT_EQ(childOfAnimatingSurface->visibleContentRect(), IntRect(IntPoint(), childOfAnimatingSurface->contentBounds()));
    28542854}
    28552855
     
    32093209TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
    32103210{
    3211     // A layer's visibleLayerRect is actually in the layer's content space. The
     3211    // A layer's visibleContentRect is actually in the layer's content space. The
    32123212    // screenSpaceTransform converts from the layer's origin space to screen space. This
    32133213    // test makes sure that hit testing works correctly accounts for the contents scale.
     
    32173217    //
    32183218    // To test this, the layer is positioned at (25, 25), and is size (50, 50). If
    3219     // contentsScale is ignored, then hit testing will mis-interpret the visibleLayerRect
     3219    // contentsScale is ignored, then hit testing will mis-interpret the visibleContentRect
    32203220    // as being larger than the actual bounds of the layer.
    32213221    //
     
    32433243
    32443244    // Sanity check the scenario we just created.
    3245     // The visibleLayerRect is actually 100x100, even though the layout size of the layer is 50x50, positioned at 25x25.
    3246     EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), root->visibleLayerRect());
     3245    // The visibleContentRect is actually 100x100, even though the layout size of the layer is 50x50, positioned at 25x25.
     3246    EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), root->visibleContentRect());
    32473247    ASSERT_EQ(1u, renderSurfaceLayerList.size());
    32483248    ASSERT_EQ(1u, root->renderSurface()->layerList().size());
     
    34193419    // (4, 50) is inside the unclipped layer, but that corner of the layer should be
    34203420    // clipped away by the grandParent and should not get hit. If hit testing blindly uses
    3421     // visibleLayerRect without considering how parent may clip the layer, then hit
     3421    // visibleContentRect without considering how parent may clip the layer, then hit
    34223422    // testing would accidentally think that the point successfully hits the layer.
    34233423    testPoint = IntPoint(4, 50);
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp

    r122360 r122373  
    102102        root->setBounds(IntSize(10, 10));
    103103        root->setContentBounds(IntSize(10, 10));
    104         root->setVisibleLayerRect(IntRect(0, 0, 10, 10));
     104        root->setVisibleContentRect(IntRect(0, 0, 10, 10));
    105105        root->setDrawsContent(true);
    106106        myHostImpl->setRootLayer(root.release());
     
    630630        setDrawsContent(true);
    631631        setSkipsDraw(false);
    632         setVisibleLayerRect(IntRect(0, 0, 10, 10));
     632        setVisibleContentRect(IntRect(0, 0, 10, 10));
    633633
    634634        OwnPtr<CCLayerTilingData> tiler = CCLayerTilingData::create(IntSize(100, 100), CCLayerTilingData::HasBorderTexels);
     
    652652    root->addChild(DidDrawCheckLayer::create(2));
    653653    DidDrawCheckLayer* layer = static_cast<DidDrawCheckLayer*>(root->children()[0].get());
    654     // Ensure visibleLayerRect for layer is empty
     654    // Ensure visibleContentRect for layer is empty
    655655    layer->setPosition(FloatPoint(100, 100));
    656656    layer->setBounds(IntSize(10, 10));
     
    669669    EXPECT_FALSE(layer->didDrawCalled());
    670670
    671     EXPECT_TRUE(layer->visibleLayerRect().isEmpty());
    672 
    673     // Ensure visibleLayerRect for layer layer is not empty
     671    EXPECT_TRUE(layer->visibleContentRect().isEmpty());
     672
     673    // Ensure visibleContentRect for layer layer is not empty
    674674    layer->setPosition(FloatPoint(0, 0));
    675675
     
    684684    EXPECT_TRUE(layer->didDrawCalled());
    685685
    686     EXPECT_FALSE(layer->visibleLayerRect().isEmpty());
     686    EXPECT_FALSE(layer->visibleContentRect().isEmpty());
    687687}
    688688
     
    18591859    root->setBounds(IntSize(rootRect.width(), rootRect.height()));
    18601860    root->setContentBounds(root->bounds());
    1861     root->setVisibleLayerRect(rootRect);
     1861    root->setVisibleContentRect(rootRect);
    18621862    root->setDrawsContent(false);
    18631863    root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height())));
     
    18681868    child->setBounds(IntSize(childRect.width(), childRect.height()));
    18691869    child->setContentBounds(child->bounds());
    1870     child->setVisibleLayerRect(childRect);
     1870    child->setVisibleContentRect(childRect);
    18711871    child->setDrawsContent(false);
    18721872
     
    18751875    grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
    18761876    grandChild->setContentBounds(grandChild->bounds());
    1877     grandChild->setVisibleLayerRect(grandChildRect);
     1877    grandChild->setVisibleContentRect(grandChildRect);
    18781878    grandChild->setDrawsContent(true);
    18791879
     
    24242424    root->setBounds(rootSize);
    24252425    root->setContentBounds(rootSize);
    2426     root->setVisibleLayerRect(IntRect(IntPoint(0, 0), rootSize));
     2426    root->setVisibleContentRect(IntRect(IntPoint(0, 0), rootSize));
    24272427    root->setDrawsContent(true);
    24282428    layerTreeHostImpl->setRootLayer(root.release());
     
    24362436    intermediateLayerPtr->setBounds(rootSize);
    24372437    intermediateLayerPtr->setContentBounds(rootSize);
    2438     intermediateLayerPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), rootSize));
     2438    intermediateLayerPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), rootSize));
    24392439    intermediateLayerPtr->setDrawsContent(false); // only children draw content
    24402440    rootPtr->addChild(intermediateLayer.release());
     
    24502450    surfaceLayerPtr->setBounds(surfaceSize);
    24512451    surfaceLayerPtr->setContentBounds(surfaceSize);
    2452     surfaceLayerPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), surfaceSize));
     2452    surfaceLayerPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), surfaceSize));
    24532453    surfaceLayerPtr->setDrawsContent(false); // only children draw content
    24542454    surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
     
    24642464    childPtr->setBounds(childSize);
    24652465    childPtr->setContentBounds(childSize);
    2466     childPtr->setVisibleLayerRect(IntRect(IntPoint(0, 0), childSize));
     2466    childPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), childSize));
    24672467    childPtr->setDrawsContent(true);
    24682468
     
    29472947
    29482948    // One shared state for all quads - we don't need the correct details
    2949     testData.sharedQuadState = CCSharedQuadState::create(WebTransformationMatrix(), WebTransformationMatrix(), IntRect(), IntRect(), 1.0, true);
     2949    testData.sharedQuadState = CCSharedQuadState::create(WebTransformationMatrix(), IntRect(), IntRect(), 1.0, true);
    29502950
    29512951    const char* currentChar = testScript;
     
    30163016                IntRect quadRect = IntRect(0, 0, 1, 1);
    30173017                IntRect contentsChangedRect = contentsChanged ? quadRect : IntRect();
    3018                 OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, refRenderPassPtr, isReplica, WebKit::WebFilterOperations(), WebKit::WebFilterOperations(), 1, contentsChangedRect);
     3018                OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, refRenderPassPtr, isReplica, WebKit::WebTransformationMatrix(), WebKit::WebFilterOperations(), WebKit::WebFilterOperations(), 1, contentsChangedRect);
    30193019                static_cast<CCTestRenderPass*>(renderPass.get())->appendQuad(quad.release());
    30203020            }
  • trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp

    r122160 r122373  
    6363    {
    6464        if (m_overrideOpaqueContentsRect)
    65             return intersection(m_opaqueContentsRect, visibleLayerRect());
     65            return intersection(m_opaqueContentsRect, visibleContentRect());
    6666        return LayerChromium::visibleContentOpaqueRegion();
    6767    }
     
    8989    {
    9090        if (m_overrideOpaqueContentsRect)
    91             return intersection(m_opaqueContentsRect, visibleLayerRect());
     91            return intersection(m_opaqueContentsRect, visibleContentRect());
    9292        return CCLayerImpl::visibleContentOpaqueRegion();
    9393    }
     
    760760        EXPECT_INT_RECT_EQ(IntRect(9, 430, 60, 80), occlusion.unoccludedContentRect(child, IntRect(9, 430, 60, 80)));
    761761        // This extends past two adjacent sides of child2, and should included the unoccluded parts of each side.
    762         // This also demonstrates that the rect can be arbitrary and does not get clipped to the layer's visibleLayerRect().
     762        // This also demonstrates that the rect can be arbitrary and does not get clipped to the layer's visibleContentRect().
    763763        EXPECT_INT_RECT_EQ(IntRect(-10, 430, 20, 70), occlusion.unoccludedContentRect(child, IntRect(-10, 430, 60, 70)));
    764764        // This extends past three adjacent sides of child2, so it should contain the unoccluded parts of each side. The left
     
    870870        occlusion.setLayerScissorRect(IntRect(0, 0, 1000, 1000));
    871871
    872         IntRect clippedLayerInChild = CCMathUtil::mapClippedRect(layerTransform, layer->visibleLayerRect());
     872        IntRect clippedLayerInChild = CCMathUtil::mapClippedRect(layerTransform, layer->visibleContentRect());
    873873
    874874        this->visitLayer(layer, occlusion);
     
    20252025        TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
    20262026
    2027         // This is very close to the camera, so pixels in its visibleLayerRect will actually go outside of the layer's clipRect.
     2027        // This is very close to the camera, so pixels in its visibleContentRect will actually go outside of the layer's clipRect.
    20282028        // Ensure that those pixels don't occlude things outside the clipRect.
    20292029        this->visitLayer(layer, occlusion);
  • trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp

    r122160 r122373  
    6868    layer->setDrawTransform(drawTransform);
    6969    layer->setScreenSpaceTransform(drawTransform);
    70     layer->setVisibleLayerRect(layerRect);
     70    layer->setVisibleContentRect(layerRect);
    7171    layer->setDrawOpacity(opacity);
    7272    layer->setOpaque(opaque);
  • trunk/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp

    r122160 r122373  
    103103    IntRect contentRect = IntRect(IntPoint::zero(), IntSize(50, 50));
    104104    IntRect clipRect = IntRect(IntPoint(5, 5), IntSize(40, 40));
    105     WebTransformationMatrix draw;
    106105    WebTransformationMatrix origin;
    107106
    108     draw.translate(30, 40);
     107    origin.translate(30, 40);
    109108
    110     renderSurface->setDrawTransform(draw);
    111109    renderSurface->setOriginTransform(origin);
    112110    renderSurface->setContentRect(contentRect);
     
    117115    OwnPtr<CCSharedQuadState> sharedQuadState = renderSurface->createSharedQuadState();
    118116
    119     EXPECT_TRUE(sharedQuadState->quadTransform().isIdentity());
    120     EXPECT_EQ(30, sharedQuadState->layerTransform().m41());
    121     EXPECT_EQ(40, sharedQuadState->layerTransform().m42());
    122     EXPECT_EQ(contentRect, sharedQuadState->layerRect());
     117    EXPECT_EQ(30, sharedQuadState->quadTransform().m41());
     118    EXPECT_EQ(40, sharedQuadState->quadTransform().m42());
     119    EXPECT_EQ(contentRect, sharedQuadState->visibleContentRect());
    123120    EXPECT_EQ(clipRect, sharedQuadState->scissorRect());
    124121    EXPECT_EQ(1, sharedQuadState->opacity());
  • trunk/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp

    r122160 r122373  
    4646    MockCCQuadCuller quadCuller;
    4747    IntSize layerSize = IntSize(800, 600);
    48     IntRect visibleLayerRect = IntRect(IntPoint(), layerSize);
     48    IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
    4949
    5050    OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1);
    51     layer->setVisibleLayerRect(visibleLayerRect);
     51    layer->setVisibleContentRect(visibleContentRect);
    5252    layer->setBounds(layerSize);
    5353
     
    5656    layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles);
    5757
    58     verifyQuadsExactlyCoverRect(quadCuller.quadList(), visibleLayerRect);
     58    verifyQuadsExactlyCoverRect(quadCuller.quadList(), visibleContentRect);
    5959}
    6060
     
    6767    MockCCQuadCuller quadCuller;
    6868    IntSize layerSize = IntSize(100, 100);
    69     IntRect visibleLayerRect = IntRect(IntPoint(), layerSize);
     69    IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
    7070
    7171    OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1);
    72     layer->setVisibleLayerRect(visibleLayerRect);
     72    layer->setVisibleContentRect(visibleContentRect);
    7373    layer->setBounds(layerSize);
    7474    layer->setBackgroundColor(testColor);
     
    9090    MockCCQuadCuller quadCuller;
    9191    IntSize layerSize = IntSize(100, 100);
    92     IntRect visibleLayerRect = IntRect(IntPoint(), layerSize);
     92    IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
    9393
    9494    OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1);
    95     layer->setVisibleLayerRect(visibleLayerRect);
     95    layer->setVisibleContentRect(visibleContentRect);
    9696    layer->setBounds(layerSize);
    9797    layer->setDrawOpacity(opacity);
  • trunk/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp

    r122160 r122373  
    4949    layer->setTilingData(*tiler);
    5050    layer->setSkipsDraw(false);
    51     layer->setVisibleLayerRect(IntRect(IntPoint(), layerSize));
     51    layer->setVisibleContentRect(IntRect(IntPoint(), layerSize));
    5252    layer->setDrawOpacity(1);
    5353
     
    8383    {
    8484        OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels);
    85         layer->setVisibleLayerRect(IntRect());
     85        layer->setVisibleContentRect(IntRect());
    8686
    8787        MockCCQuadCuller quadCuller;
     
    9797
    9898        IntRect outsideBounds(IntPoint(-100, -100), IntSize(50, 50));
    99         layer->setVisibleLayerRect(outsideBounds);
     99        layer->setVisibleContentRect(outsideBounds);
    100100
    101101        MockCCQuadCuller quadCuller;
     
    159159}
    160160
    161 static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleLayerRect)
     161static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleContentRect)
    162162{
    163163    OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption);
    164     layer->setVisibleLayerRect(visibleLayerRect);
     164    layer->setVisibleContentRect(visibleContentRect);
    165165    layer->setBounds(layerSize);
    166166
     
    202202    IntPoint topLeft(65, 73);
    203203    IntPoint bottomRight(182, 198);
    204     IntRect visibleLayerRect(topLeft, bottomRight - topLeft);
     204    IntRect visibleContentRect(topLeft, bottomRight - topLeft);
    205205
    206206    IntSize layerSize(250, 250);
    207207    CCQuadList quads;
    208208    OwnPtr<CCSharedQuadState> sharedState;
    209     sharedState = getQuads(quads, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visibleLayerRect);
    210     verifyQuadsExactlyCoverRect(quads, visibleLayerRect);
     209    sharedState = getQuads(quads, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visibleContentRect);
     210    verifyQuadsExactlyCoverRect(quads, visibleContentRect);
    211211}
    212212WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsTiles);
     
    217217
    218218    IntSize layerSize(220, 210);
    219     IntRect visibleLayerRect(IntPoint(), layerSize);
    220     CCQuadList quads;
    221     OwnPtr<CCSharedQuadState> sharedState;
    222     sharedState = getQuads(quads, IntSize(100, 100), layerSize, CCLayerTilingData::NoBorderTexels, visibleLayerRect);
    223     verifyQuadsExactlyCoverRect(quads, visibleLayerRect);
     219    IntRect visibleContentRect(IntPoint(), layerSize);
     220    CCQuadList quads;
     221    OwnPtr<CCSharedQuadState> sharedState;
     222    sharedState = getQuads(quads, IntSize(100, 100), layerSize, CCLayerTilingData::NoBorderTexels, visibleContentRect);
     223    verifyQuadsExactlyCoverRect(quads, visibleContentRect);
    224224}
    225225WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsBounds);
  • trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp

    r121870 r122373  
    6969    m_lastUpdateRect = contentRect;
    7070    if (!m_rectToInvalidate.isEmpty()) {
    71         m_layer->invalidateRect(m_rectToInvalidate);
     71        m_layer->invalidateContentRect(m_rectToInvalidate);
    7272        m_rectToInvalidate = IntRect();
    7373        m_layer = 0;
     
    119119void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
    120120{
    121     updateLayerRect(updater, visibleLayerRect(), occlusion);
     121    updateContentRect(updater, visibleContentRect(), occlusion);
    122122}
    123123
  • trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h

    r122185 r122373  
    111111    static WebCore::IntSize tileSize() { return WebCore::IntSize(100, 100); }
    112112
    113     using WebCore::TiledLayerChromium::invalidateRect;
    114     using WebCore::TiledLayerChromium::updateLayerRect;
     113    using WebCore::TiledLayerChromium::invalidateContentRect;
     114    using WebCore::TiledLayerChromium::updateContentRect;
    115115    using WebCore::TiledLayerChromium::needsIdlePaint;
    116116    using WebCore::TiledLayerChromium::skipsDraw;
     
    121121    const WebCore::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; }
    122122
    123     // Updates the visibleLayerRect().
     123    // Updates the visibleContentRect().
    124124    virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*) OVERRIDE;
    125125
  • trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp

    r121628 r122373  
    495495
    496496    // Test properties that should not call needsDisplay and needsCommit when changed.
    497     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleLayerRect(IntRect(0, 0, 40, 50)));
     497    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContentRect(IntRect(0, 0, 40, 50)));
    498498    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUsesLayerClipping(true));
    499499    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setIsNonCompositedContent(true));
  • trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

    r122185 r122373  
    102102    // The tile size is 100x100, so this invalidates and then paints two tiles.
    103103    layer->setBounds(IntSize(100, 200));
    104     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    105     layer->invalidateRect(IntRect(0, 0, 100, 200));
    106 
    107     layer->setTexturePriorities(priorityCalculator);
    108     textureManager->prioritizeTextures(0);
    109 
    110     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     104    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
     105    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     106
     107    layer->setTexturePriorities(priorityCalculator);
     108    textureManager->prioritizeTextures(0);
     109
     110    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    111111    updateTextures();
    112112    layer->pushPropertiesTo(layerImpl.get());
     
    117117
    118118    // Invalidates both tiles...
    119     layer->invalidateRect(IntRect(0, 0, 100, 200));
     119    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
    120120    // ....but then only update one of them.
    121121    layer->setTexturePriorities(priorityCalculator);
    122122    textureManager->prioritizeTextures(0);
    123     layer->updateLayerRect(updater, IntRect(0, 0, 100, 100), 0);
     123    layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0);
    124124    layer->pushPropertiesTo(layerImpl.get());
    125125
     
    141141    layer->setBounds(IntSize(100, 200));
    142142    layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
    143     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    144     layer->invalidateRect(IntRect(0, 0, 100, 200));
    145 
    146     layer->setTexturePriorities(priorityCalculator);
    147     textureManager->prioritizeTextures(0);
    148 
    149     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), &occluded);
     143    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
     144    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     145
     146    layer->setTexturePriorities(priorityCalculator);
     147    textureManager->prioritizeTextures(0);
     148
     149    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), &occluded);
    150150    updateTextures();
    151151    layer->pushPropertiesTo(layerImpl.get());
     
    160160
    161161    // Invalidates part of the top tile...
    162     layer->invalidateRect(IntRect(0, 0, 50, 50));
     162    layer->invalidateContentRect(IntRect(0, 0, 50, 50));
    163163    // ....but the area is occluded.
    164164    occluded.setOcclusion(IntRect(0, 0, 50, 50));
    165     layer->updateLayerRect(updater, IntRect(0, 0, 100, 100), &occluded);
     165    layer->updateContentRect(updater, IntRect(0, 0, 100, 100), &occluded);
    166166    updateTextures();
    167167    layer->pushPropertiesTo(layerImpl.get());
     
    185185    // The tile size is 100x100, so this invalidates and then paints two tiles.
    186186    layer->setBounds(IntSize(100, 200));
    187     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    188     layer->invalidateRect(IntRect(0, 0, 100, 200));
    189 
    190     layer->setTexturePriorities(priorityCalculator);
    191     textureManager->prioritizeTextures(0);
    192 
    193     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     187    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
     188    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     189
     190    layer->setTexturePriorities(priorityCalculator);
     191    textureManager->prioritizeTextures(0);
     192
     193    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    194194    updateTextures();
    195195    layer->pushPropertiesTo(layerImpl.get());
     
    213213    layer->setTexturePriorities(priorityCalculator);
    214214    textureManager->prioritizeTextures(0);
    215     layer->updateLayerRect(updater, IntRect(0, 0, 100, 100), 0);
     215    layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0);
    216216    updateTextures();
    217217    layer->pushPropertiesTo(layerImpl.get());
     
    236236    // This invalidates 25 tiles and then paints one visible tile.
    237237    layer->setBounds(contentBounds);
    238     layer->setVisibleLayerRect(visibleRect);
    239     layer->invalidateRect(contentRect);
    240 
    241     layer->setTexturePriorities(priorityCalculator);
    242     textureManager->prioritizeTextures(0);
    243 
    244     layer->updateLayerRect(updater, visibleRect, 0);
     238    layer->setVisibleContentRect(visibleRect);
     239    layer->invalidateContentRect(contentRect);
     240
     241    layer->setTexturePriorities(priorityCalculator);
     242    textureManager->prioritizeTextures(0);
     243
     244    layer->updateContentRect(updater, visibleRect, 0);
    245245    updateTextures();
    246246
     
    258258        textureManager->prioritizeTextures(0);
    259259
    260         layer->updateLayerRect(updater, visibleRect, 0);
     260        layer->updateContentRect(updater, visibleRect, 0);
    261261        EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
    262262        updateTextures();
     
    296296    IntRect layer2Rect(0, 0, 100, 300);
    297297    layer2->setBounds(layer2Rect.size());
    298     layer2->setVisibleLayerRect(layer2Rect);
    299     layer2->invalidateRect(layer2Rect);
     298    layer2->setVisibleContentRect(layer2Rect);
     299    layer2->invalidateContentRect(layer2Rect);
    300300
    301301    // This uses 960000 bytes, leaving 88576 bytes of memory left, which is enough for 2 tiles only in the other layer.
    302302    IntRect layerRect(IntPoint::zero(), IntSize(100, 2400));
    303303    layer1->setBounds(layerRect.size());
    304     layer1->setVisibleLayerRect(layerRect);
    305     layer1->invalidateRect(layerRect);
     304    layer1->setVisibleContentRect(layerRect);
     305    layer1->invalidateContentRect(layerRect);
    306306
    307307    // Paint a single tile in layer2 so that it will idle paint.
     
    309309    layer1->setTexturePriorities(priorityCalculator);
    310310    textureManager->prioritizeTextures(0);
    311     layer1->updateLayerRect(updater, layerRect, 0);
    312     layer2->updateLayerRect(updater, IntRect(0, 0, 100, 100), 0);
     311    layer1->updateContentRect(updater, layerRect, 0);
     312    layer2->updateContentRect(updater, IntRect(0, 0, 100, 100), 0);
    313313
    314314    // We should need idle-painting for both remaining tiles in layer2.
     
    327327    layer1->setTexturePriorities(priorityCalculator);
    328328    textureManager->prioritizeTextures(0);
    329     layer2->updateLayerRect(updater, IntRect(0, 0, 100, 100), 0);
     329    layer2->updateContentRect(updater, IntRect(0, 0, 100, 100), 0);
    330330
    331331    // Oh well, commit the frame and push.
     
    347347    layer1->setTexturePriorities(priorityCalculator);
    348348    textureManager->prioritizeTextures(0);
    349     layer2->updateLayerRect(updater, layer2Rect, 0);
    350     layer1->updateLayerRect(updater, layerRect, 0);
     349    layer2->updateContentRect(updater, layer2Rect, 0);
     350    layer1->updateContentRect(updater, layerRect, 0);
    351351
    352352    updateTextures();
     
    375375    layer->setBounds(IntSize(100, 100));
    376376    layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
    377     layer->setVisibleLayerRect(IntRect(0, 0, 100, 100));
    378     layer->invalidateRect(IntRect(0, 0, 100, 100));
    379 
    380     layer->setTexturePriorities(priorityCalculator);
    381     textureManager->prioritizeTextures(0);
    382     layer->updateLayerRect(updater, IntRect(0, 0, 100, 100), &occluded);
     377    layer->setVisibleContentRect(IntRect(0, 0, 100, 100));
     378    layer->invalidateContentRect(IntRect(0, 0, 100, 100));
     379
     380    layer->setTexturePriorities(priorityCalculator);
     381    textureManager->prioritizeTextures(0);
     382    layer->updateContentRect(updater, IntRect(0, 0, 100, 100), &occluded);
    383383    updateTextures();
    384384    layer->pushPropertiesTo(layerImpl.get());
     
    399399    // not prevent the tile from being pushed.
    400400    layer->setBounds(IntSize(100, 200));
    401     layer->invalidateRect(IntRect(0, 0, 100, 200));
    402     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
     401    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     402    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
    403403    layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get());
    404404
    405405    layer->setTexturePriorities(priorityCalculator);
    406406    textureManager->prioritizeTextures(0);
    407     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     407    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    408408    updateTextures();
    409409    layer->pushPropertiesTo(layerImpl.get());
     
    424424
    425425    layer1->setBounds(IntSize(100, 200));
    426     layer1->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    427     layer1->invalidateRect(IntRect(0, 0, 100, 200));
     426    layer1->setVisibleContentRect(IntRect(0, 0, 100, 200));
     427    layer1->invalidateContentRect(IntRect(0, 0, 100, 200));
    428428
    429429    layer2->setBounds(IntSize(100, 200));
    430     layer2->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    431     layer2->invalidateRect(IntRect(0, 0, 100, 200));
     430    layer2->setVisibleContentRect(IntRect(0, 0, 100, 200));
     431    layer2->invalidateContentRect(IntRect(0, 0, 100, 200));
    432432
    433433    layer1->setTexturePriorities(priorityCalculator);
     
    435435    textureManager->prioritizeTextures(0);
    436436
    437     layer1->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     437    layer1->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    438438
    439439    // Invalidate a tile on layer1
    440440    layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
    441     layer2->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     441    layer2->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    442442
    443443    updateTextures();
     
    462462
    463463    layer1->setBounds(IntSize(100, 200));
    464     layer1->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    465     layer1->invalidateRect(IntRect(0, 0, 100, 200));
     464    layer1->setVisibleContentRect(IntRect(0, 0, 100, 200));
     465    layer1->invalidateContentRect(IntRect(0, 0, 100, 200));
    466466
    467467    layer2->setBounds(IntSize(100, 200));
    468     layer2->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    469     layer2->invalidateRect(IntRect(0, 0, 100, 200));
     468    layer2->setVisibleContentRect(IntRect(0, 0, 100, 200));
     469    layer2->invalidateContentRect(IntRect(0, 0, 100, 200));
    470470
    471471    layer1->setTexturePriorities(priorityCalculator);
     
    475475    // Invalidate a tile on layer2
    476476    layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
    477     layer1->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
    478     layer2->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     477    layer1->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
     478    layer2->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    479479    updateTextures();
    480480    layer1->pushPropertiesTo(layer1Impl.get());
     
    505505    // Invalidates 9 tiles and then paints one visible tile.
    506506    layer->setBounds(contentBounds);
    507     layer->setVisibleLayerRect(visibleRect);
    508     layer->invalidateRect(contentRect);
    509 
    510     layer->setTexturePriorities(priorityCalculator);
    511     textureManager->prioritizeTextures(0);
    512     layer->updateLayerRect(updater, visibleRect, 0);
     507    layer->setVisibleContentRect(visibleRect);
     508    layer->invalidateContentRect(contentRect);
     509
     510    layer->setTexturePriorities(priorityCalculator);
     511    textureManager->prioritizeTextures(0);
     512    layer->updateContentRect(updater, visibleRect, 0);
    513513
    514514    // Idle-painting should see no more priority tiles for painting.
     
    523523    layer->setTexturePriorities(priorityCalculator);
    524524    textureManager->prioritizeTextures(0);
    525     layer->updateLayerRect(updater, visibleRect, 0);
     525    layer->updateContentRect(updater, visibleRect, 0);
    526526
    527527    // We shouldn't signal we need another idle paint.
     
    545545
    546546        layer->setBounds(contentRect.size());
    547         layer->setVisibleLayerRect(contentRect);
    548         layer->invalidateRect(contentRect);
     547        layer->setVisibleContentRect(contentRect);
     548        layer->invalidateContentRect(contentRect);
    549549
    550550        layer->setTexturePriorities(priorityCalculator);
     
    552552
    553553        // Empty layers don't paint or idle-paint.
    554         layer->updateLayerRect(updater, contentRect, 0);
     554        layer->updateContentRect(updater, contentRect, 0);
    555555
    556556        // Empty layers don't have tiles.
     
    581581
    582582    layer->setBounds(contentBounds);
    583     layer->setVisibleLayerRect(visibleRect);
    584     layer->invalidateRect(contentRect);
     583    layer->setVisibleContentRect(visibleRect);
     584    layer->invalidateContentRect(contentRect);
    585585
    586586    for (int i = 0; i < 2; i++) {
     
    588588        layer->setTexturePriorities(priorityCalculator);
    589589        textureManager->prioritizeTextures(0);
    590         layer->updateLayerRect(updater, visibleRect, 0);
     590        layer->updateContentRect(updater, visibleRect, 0);
    591591
    592592        // Non-visible layers don't need idle paint.
     
    633633
    634634            layer->setBounds(contentBounds);
    635             layer->setVisibleLayerRect(visibleRect);
    636             layer->invalidateRect(contentRect);
     635            layer->setVisibleContentRect(visibleRect);
     636            layer->invalidateContentRect(contentRect);
    637637
    638638            layer->setTexturePriorities(priorityCalculator);
     
    651651                textureManager->prioritizeTextures(0);
    652652
    653                 layer->updateLayerRect(updater, visibleRect, 0);
     653                layer->updateContentRect(updater, visibleRect, 0);
    654654                updateTextures();
    655655                layer->pushPropertiesTo(layerImpl.get());
     
    664664                textureManager->prioritizeTextures(0);
    665665
    666                 layer->updateLayerRect(updater, visibleRect, 0);
     666                layer->updateContentRect(updater, visibleRect, 0);
    667667                updateTextures();
    668668                layer->pushPropertiesTo(layerImpl.get());
     
    688688    // The tile size is 100x100, so this invalidates and then paints two tiles.
    689689    layer->setBounds(IntSize(100, 200));
    690     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    691     layer->invalidateRect(IntRect(0, 0, 100, 200));
    692     layer->setTexturePriorities(priorityCalculator);
    693     textureManager->prioritizeTextures(0);
    694     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     690    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
     691    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     692    layer->setTexturePriorities(priorityCalculator);
     693    textureManager->prioritizeTextures(0);
     694    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    695695    updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
    696696    layer->pushPropertiesTo(layerImpl.get());
     
    701701
    702702    layer->fakeLayerTextureUpdater()->clearPrepareCount();
    703     // Invoke updateLayerRect again. As the layer is valid updateLayerRect shouldn't be invoked on
     703    // Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on
    704704    // the LayerTextureUpdater.
    705     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     705    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    706706    updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
    707707    EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
    708708
    709     layer->invalidateRect(IntRect(0, 0, 50, 50));
    710     // setRectToInvalidate triggers invalidateRect() being invoked from updateLayerRect.
     709    layer->invalidateContentRect(IntRect(0, 0, 50, 50));
     710    // setRectToInvalidate triggers invalidateContentRect() being invoked from updateContentRect.
    711711    layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
    712712    layer->fakeLayerTextureUpdater()->clearPrepareCount();
    713     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     713    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    714714    updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
    715715    EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
    716716    layer->fakeLayerTextureUpdater()->clearPrepareCount();
    717     // The layer should still be invalid as updateLayerRect invoked invalidate.
    718     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     717    // The layer should still be invalid as updateContentRect invoked invalidate.
     718    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    719719    updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000);
    720720    EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
     
    734734    layer->setBounds(layerBounds.size());
    735735    layer->setContentBounds(contentBounds.size());
    736     layer->setVisibleLayerRect(contentBounds);
     736    layer->setVisibleContentRect(contentBounds);
    737737
    738738    // On first update, the updateRect includes all tiles, even beyond the boundaries of the layer.
    739739    // However, it should still be in layer space, not content space.
    740     layer->invalidateRect(contentBounds);
    741 
    742     layer->setTexturePriorities(priorityCalculator);
    743     textureManager->prioritizeTextures(0);
    744     layer->updateLayerRect(updater, contentBounds, 0);
     740    layer->invalidateContentRect(contentBounds);
     741
     742    layer->setTexturePriorities(priorityCalculator);
     743    textureManager->prioritizeTextures(0);
     744    layer->updateContentRect(updater, contentBounds, 0);
    745745    EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect());
    746746    updateTextures();
     
    749749    layer->setTexturePriorities(priorityCalculator);
    750750    textureManager->prioritizeTextures(0);
    751     layer->invalidateRect(contentBounds);
    752     layer->updateLayerRect(updater, contentBounds, 0);
     751    layer->invalidateContentRect(contentBounds);
     752    layer->updateContentRect(updater, contentBounds, 0);
    753753    EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect());
    754754    updateTextures();
     
    756756    // Partial re-paint should also be represented by the updateRect in layer space, not content space.
    757757    IntRect partialDamage(30, 100, 10, 10);
    758     layer->invalidateRect(partialDamage);
    759     layer->setTexturePriorities(priorityCalculator);
    760     textureManager->prioritizeTextures(0);
    761     layer->updateLayerRect(updater, contentBounds, 0);
     758    layer->invalidateContentRect(partialDamage);
     759    layer->setTexturePriorities(priorityCalculator);
     760    textureManager->prioritizeTextures(0);
     761    layer->updateContentRect(updater, contentBounds, 0);
    762762    EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect());
    763763}
     
    772772    // Create a layer with one tile.
    773773    layer->setBounds(IntSize(100, 100));
    774     layer->setVisibleLayerRect(IntRect(0, 0, 100, 100));
     774    layer->setVisibleContentRect(IntRect(0, 0, 100, 100));
    775775
    776776    // Invalidate the entire layer.
     
    781781    layer->setTexturePriorities(priorityCalculator);
    782782    textureManager->prioritizeTextures(0);
    783     layer->updateLayerRect(updater, IntRect(0, 0, 100, 100), 0);
     783    layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0);
    784784    updateTextures();
    785785    layer->pushPropertiesTo(layerImpl.get());
     
    792792    // is not scaled.
    793793    layer->setContentsScale(2);
    794     layer->setVisibleLayerRect(IntRect(0, 0, 200, 200));
     794    layer->setVisibleContentRect(IntRect(0, 0, 200, 200));
    795795    EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 100, 100), layer->lastNeedsDisplayRect());
    796796
     
    798798    layer->setTexturePriorities(priorityCalculator);
    799799    textureManager->prioritizeTextures(0);
    800     layer->updateLayerRect(updater, IntRect(0, 0, 200, 200), 0);
     800    layer->updateContentRect(updater, IntRect(0, 0, 200, 200), 0);
    801801    updateTextures();
    802802    layer->pushPropertiesTo(layerImpl.get());
     
    810810    layer->setNeedsDisplay();
    811811    layer->setTexturePriorities(priorityCalculator);
    812     layer->updateLayerRect(updater, IntRect(1, 0, 0, 1), 0);
     812    layer->updateContentRect(updater, IntRect(1, 0, 0, 1), 0);
    813813    textureManager->prioritizeTextures(0);
    814814
     
    840840
    841841    rootLayer->setBounds(contentBounds);
    842     rootLayer->setVisibleLayerRect(contentRect);
     842    rootLayer->setVisibleContentRect(contentRect);
    843843    rootLayer->setPosition(FloatPoint(150, 150));
    844844    childLayer->setBounds(contentBounds);
    845     childLayer->setVisibleLayerRect(contentRect);
     845    childLayer->setVisibleContentRect(contentRect);
    846846    childLayer->setPosition(FloatPoint(150, 150));
    847     rootLayer->invalidateRect(contentRect);
    848     childLayer->invalidateRect(contentRect);
     847    rootLayer->invalidateContentRect(contentRect);
     848    childLayer->invalidateContentRect(contentRect);
    849849
    850850    ccLayerTreeHost->setRootLayer(rootLayer);
     
    877877
    878878    layer->setBounds(IntSize(700, 700));
    879     layer->setVisibleLayerRect(IntRect(0, 0, 700, 700));
    880     layer->invalidateRect(IntRect(0, 0, 700, 700));
    881 
    882     layer->setTexturePriorities(priorityCalculator);
    883     textureManager->prioritizeTextures(0);
    884     layer->updateLayerRect(updater, IntRect(0, 0, 700, 700), 0);
     879    layer->setVisibleContentRect(IntRect(0, 0, 700, 700));
     880    layer->invalidateContentRect(IntRect(0, 0, 700, 700));
     881
     882    layer->setTexturePriorities(priorityCalculator);
     883    textureManager->prioritizeTextures(0);
     884    layer->updateContentRect(updater, IntRect(0, 0, 700, 700), 0);
    885885
    886886    layer->setBounds(IntSize(200, 200));
    887     layer->invalidateRect(IntRect(0, 0, 200, 200));
     887    layer->invalidateContentRect(IntRect(0, 0, 200, 200));
    888888}
    889889
     
    895895    int size = 1 << 30;
    896896    layer->setBounds(IntSize(size, size));
    897     layer->setVisibleLayerRect(IntRect(0, 0, 700, 700));
    898     layer->invalidateRect(IntRect(0, 0, size, size));
     897    layer->setVisibleContentRect(IntRect(0, 0, 700, 700));
     898    layer->invalidateContentRect(IntRect(0, 0, size, size));
    899899
    900900    // Ensure no crash for bounds where size * size would overflow an int.
    901901    layer->setTexturePriorities(priorityCalculator);
    902902    textureManager->prioritizeTextures(0);
    903     layer->updateLayerRect(updater, IntRect(0, 0, 700, 700), 0);
     903    layer->updateContentRect(updater, IntRect(0, 0, 700, 700), 0);
    904904}
    905905
     
    923923    layer->setBounds(contentBounds);
    924924    layer->setPosition(FloatPoint(150, 150));
    925     layer->setVisibleLayerRect(contentRect);
    926     layer->invalidateRect(contentRect);
     925    layer->setVisibleContentRect(contentRect);
     926    layer->invalidateContentRect(contentRect);
    927927
    928928    ccLayerTreeHost->setRootLayer(layer);
     
    947947
    948948    // Full update of 3 tiles and partial update of 3 tiles.
    949     layer->invalidateRect(IntRect(0, 0, 300, 150));
     949    layer->invalidateContentRect(IntRect(0, 0, 300, 150));
    950950    ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max());
    951951    {
     
    965965
    966966    // Partial update of 6 tiles.
    967     layer->invalidateRect(IntRect(50, 50, 200, 100));
     967    layer->invalidateContentRect(IntRect(50, 50, 200, 100));
    968968    {
    969969        DebugScopedSetImplThread implThread;
     
    983983
    984984    // Checkerboard all tiles.
    985     layer->invalidateRect(IntRect(0, 0, 300, 200));
     985    layer->invalidateContentRect(IntRect(0, 0, 300, 200));
    986986    {
    987987        DebugScopedSetImplThread implThread;
     
    992992
    993993    // Partial update of 6 checkerboard tiles.
    994     layer->invalidateRect(IntRect(50, 50, 200, 100));
     994    layer->invalidateContentRect(IntRect(50, 50, 200, 100));
    995995    {
    996996        DebugScopedSetImplThread implThread;
     
    10101010
    10111011    // Partial update of 4 tiles.
    1012     layer->invalidateRect(IntRect(50, 50, 100, 100));
     1012    layer->invalidateContentRect(IntRect(50, 50, 100, 100));
    10131013    {
    10141014        DebugScopedSetImplThread implThread;
     
    10361036    // The tile size is 100x100, so this invalidates and then paints two tiles.
    10371037    layer->setBounds(IntSize(100, 200));
    1038     layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
    1039     layer->invalidateRect(IntRect(0, 0, 100, 200));
    1040 
    1041     layer->setTexturePriorities(priorityCalculator);
    1042     textureManager->prioritizeTextures(0);
    1043     layer->updateLayerRect(updater, IntRect(0, 0, 100, 200), 0);
     1038    layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
     1039    layer->invalidateContentRect(IntRect(0, 0, 100, 200));
     1040
     1041    layer->setTexturePriorities(priorityCalculator);
     1042    textureManager->prioritizeTextures(0);
     1043    layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0);
    10441044    EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10451045}
     
    10571057
    10581058    occluded.setOcclusion(IntRect(200, 200, 300, 100));
    1059     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
    1060     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1061 
    1062     layer->setTexturePriorities(priorityCalculator);
    1063     textureManager->prioritizeTextures(0);
    1064     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1059    layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
     1060    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1061
     1062    layer->setTexturePriorities(priorityCalculator);
     1063    textureManager->prioritizeTextures(0);
     1064    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    10651065    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10661066
     
    10721072
    10731073    occluded.setOcclusion(IntRect(250, 200, 300, 100));
    1074     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1075     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1074    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1075    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    10761076    EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10771077
     
    10831083
    10841084    occluded.setOcclusion(IntRect(250, 250, 300, 100));
    1085     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1086     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1085    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1086    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    10871087    EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount());
    10881088
     
    11051105    // The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled.
    11061106    occluded.setOcclusion(IntRect(200, 200, 300, 150));
    1107     layer->setVisibleLayerRect(IntRect(0, 0, 600, 360));
    1108     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1109 
    1110     layer->setTexturePriorities(priorityCalculator);
    1111     textureManager->prioritizeTextures(0);
    1112     layer->updateLayerRect(updater, IntRect(0, 0, 600, 360), &occluded);
     1107    layer->setVisibleContentRect(IntRect(0, 0, 600, 360));
     1108    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1109
     1110    layer->setTexturePriorities(priorityCalculator);
     1111    textureManager->prioritizeTextures(0);
     1112    layer->updateContentRect(updater, IntRect(0, 0, 600, 360), &occluded);
    11131113    EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11141114
     
    11211121    // Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded.
    11221122    occluded.setOcclusion(IntRect(200, 200, 300, 150));
    1123     layer->setVisibleLayerRect(IntRect(0, 0, 600, 350));
    1124     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1125     layer->setTexturePriorities(priorityCalculator);
    1126     textureManager->prioritizeTextures(0);
    1127     layer->updateLayerRect(updater, IntRect(0, 0, 600, 350), &occluded);
     1123    layer->setVisibleContentRect(IntRect(0, 0, 600, 350));
     1124    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1125    layer->setTexturePriorities(priorityCalculator);
     1126    textureManager->prioritizeTextures(0);
     1127    layer->updateContentRect(updater, IntRect(0, 0, 600, 350), &occluded);
    11281128    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11291129
     
    11361136    // Now the visible region is even smaller than the occlusion, it should have the same result.
    11371137    occluded.setOcclusion(IntRect(200, 200, 300, 150));
    1138     layer->setVisibleLayerRect(IntRect(0, 0, 600, 340));
    1139     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1140     layer->setTexturePriorities(priorityCalculator);
    1141     textureManager->prioritizeTextures(0);
    1142     layer->updateLayerRect(updater, IntRect(0, 0, 600, 340), &occluded);
     1138    layer->setVisibleContentRect(IntRect(0, 0, 600, 340));
     1139    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1140    layer->setTexturePriorities(priorityCalculator);
     1141    textureManager->prioritizeTextures(0);
     1142    layer->updateContentRect(updater, IntRect(0, 0, 600, 340), &occluded);
    11431143    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11441144
     
    11611161
    11621162    occluded.setOcclusion(IntRect(200, 200, 300, 100));
    1163     layer->setVisibleLayerRect(IntRect(0, 0, 600, 600));
    1164     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1165     layer->setTexturePriorities(priorityCalculator);
    1166     textureManager->prioritizeTextures(0);
    1167     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1163    layer->setVisibleContentRect(IntRect(0, 0, 600, 600));
     1164    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1165    layer->setTexturePriorities(priorityCalculator);
     1166    textureManager->prioritizeTextures(0);
     1167    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    11681168    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11691169    updateTextures();
     
    11761176
    11771177    // Repaint without marking it dirty. The 3 culled tiles will be pre-painted now.
    1178     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1178    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    11791179    EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    11801180
     
    12011201
    12021202    occluded.setOcclusion(IntRect(100, 100, 150, 50));
    1203     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
    1204     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1205     layer->setTexturePriorities(priorityCalculator);
    1206     textureManager->prioritizeTextures(0);
    1207     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1203    layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
     1204    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1205    layer->setTexturePriorities(priorityCalculator);
     1206    textureManager->prioritizeTextures(0);
     1207    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    12081208    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12091209
     
    12291229
    12301230    occluded.setOcclusion(IntRect(200, 200, 300, 100));
    1231     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
    1232     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1233     layer->setTexturePriorities(priorityCalculator);
    1234     textureManager->prioritizeTextures(0);
    1235     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1231    layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
     1232    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1233    layer->setTexturePriorities(priorityCalculator);
     1234    textureManager->prioritizeTextures(0);
     1235    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    12361236    // The content is half the size of the layer (so the number of tiles is fewer).
    12371237    // In this case, the content is 300x300, and since the tile size is 100, the
     
    12491249    // blown up tiles.
    12501250    occluded.setOcclusion(IntRect(200, 200, 300, 200));
    1251     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
    1252     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1253     layer->setTexturePriorities(priorityCalculator);
    1254     textureManager->prioritizeTextures(0);
    1255     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1251    layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
     1252    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1253    layer->setTexturePriorities(priorityCalculator);
     1254    textureManager->prioritizeTextures(0);
     1255    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    12561256    EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12571257
     
    12691269
    12701270    occluded.setOcclusion(IntRect(100, 100, 150, 100));
    1271     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
    1272     layer->invalidateRect(IntRect(0, 0, 600, 600));
    1273     layer->setTexturePriorities(priorityCalculator);
    1274     textureManager->prioritizeTextures(0);
    1275     layer->updateLayerRect(updater, IntRect(0, 0, 600, 600), &occluded);
     1271    layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
     1272    layer->invalidateContentRect(IntRect(0, 0, 600, 600));
     1273    layer->setTexturePriorities(priorityCalculator);
     1274    textureManager->prioritizeTextures(0);
     1275    layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded);
    12761276    EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
    12771277
     
    12971297    layer->setBounds(contentBounds.size());
    12981298    layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
    1299     layer->setVisibleLayerRect(visibleBounds);
     1299    layer->setVisibleContentRect(visibleBounds);
    13001300    layer->setDrawOpacity(1);
    13011301
     
    13051305    // If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty.
    13061306    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1307     layer->invalidateRect(contentBounds);
    1308     layer->updateLayerRect(updater, contentBounds, &occluded);
     1307    layer->invalidateContentRect(contentBounds);
     1308    layer->updateContentRect(updater, contentBounds, &occluded);
    13091309    opaqueContents = layer->visibleContentOpaqueRegion();
    13101310    EXPECT_TRUE(opaqueContents.isEmpty());
     
    13181318    opaquePaintRect = IntRect(10, 10, 90, 190);
    13191319    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
    1320     layer->invalidateRect(contentBounds);
    1321     layer->updateLayerRect(updater, contentBounds, &occluded);
     1320    layer->invalidateContentRect(contentBounds);
     1321    layer->updateContentRect(updater, contentBounds, &occluded);
    13221322    updateTextures();
    13231323    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13321332    // If we paint again without invalidating, the same stuff should be opaque.
    13331333    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1334     layer->updateLayerRect(updater, contentBounds, &occluded);
     1334    layer->updateContentRect(updater, contentBounds, &occluded);
    13351335    updateTextures();
    13361336    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13461346    // not be affected.
    13471347    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1348     layer->invalidateRect(IntRect(0, 0, 1, 1));
    1349     layer->updateLayerRect(updater, contentBounds, &occluded);
     1348    layer->invalidateContentRect(IntRect(0, 0, 1, 1));
     1349    layer->updateContentRect(updater, contentBounds, &occluded);
    13501350    updateTextures();
    13511351    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13611361    // not be affected.
    13621362    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1363     layer->invalidateRect(IntRect(10, 10, 1, 1));
    1364     layer->updateLayerRect(updater, contentBounds, &occluded);
     1363    layer->invalidateContentRect(IntRect(10, 10, 1, 1));
     1364    layer->updateContentRect(updater, contentBounds, &occluded);
    13651365    updateTextures();
    13661366    opaqueContents = layer->visibleContentOpaqueRegion();
     
    13901390    layer->setBounds(contentBounds.size());
    13911391    layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
    1392     layer->setVisibleLayerRect(visibleBounds);
     1392    layer->setVisibleContentRect(visibleBounds);
    13931393    layer->setDrawOpacity(1);
    13941394
     
    13981398    // Invalidates and paints the whole layer.
    13991399    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1400     layer->invalidateRect(contentBounds);
    1401     layer->updateLayerRect(updater, contentBounds, &occluded);
     1400    layer->invalidateContentRect(contentBounds);
     1401    layer->updateContentRect(updater, contentBounds, &occluded);
    14021402    updateTextures();
    14031403    opaqueContents = layer->visibleContentOpaqueRegion();
     
    14121412    // even though it is not dirty and will not be uploaded.
    14131413    layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
    1414     layer->invalidateRect(IntRect(0, 0, 1, 1));
    1415     layer->invalidateRect(IntRect(50, 200, 10, 10));
    1416     layer->updateLayerRect(updater, contentBounds, &occluded);
     1414    layer->invalidateContentRect(IntRect(0, 0, 1, 1));
     1415    layer->invalidateContentRect(IntRect(50, 200, 10, 10));
     1416    layer->updateContentRect(updater, contentBounds, &occluded);
    14171417    updateTextures();
    14181418    opaqueContents = layer->visibleContentOpaqueRegion();
     
    14491449    root->setBounds(rootRect.size());
    14501450    root->setAnchorPoint(FloatPoint());
    1451     root->setVisibleLayerRect(rootRect);
     1451    root->setVisibleContentRect(rootRect);
    14521452    root->addChild(surface);
    14531453
     
    14611461    child->setAnchorPoint(FloatPoint());
    14621462    child->setPosition(childRect.location());
    1463     child->setVisibleLayerRect(childRect);
     1463    child->setVisibleContentRect(childRect);
    14641464
    14651465    child2->setBounds(child2Rect.size());
    14661466    child2->setAnchorPoint(FloatPoint());
    14671467    child2->setPosition(child2Rect.location());
    1468     child2->setVisibleLayerRect(child2Rect);
     1468    child2->setVisibleContentRect(child2Rect);
    14691469
    14701470    ccLayerTreeHost->setRootLayer(root);
     
    14721472
    14731473    // With a huge memory limit, all layers should update and push their textures.
    1474     root->invalidateRect(rootRect);
    1475     child->invalidateRect(childRect);
    1476     child2->invalidateRect(child2Rect);
     1474    root->invalidateContentRect(rootRect);
     1475    child->invalidateContentRect(childRect);
     1476    child2->invalidateContentRect(child2Rect);
    14771477    ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max());
    14781478    {
     
    15071507    // the child layers draw into, the child layers will not be allocated. If the surface isn't
    15081508    // accounted for, then one of the children would fit within the memory limit.
    1509     root->invalidateRect(rootRect);
    1510     child->invalidateRect(childRect);
    1511     child2->invalidateRect(child2Rect);
     1509    root->invalidateContentRect(rootRect);
     1510    child->invalidateContentRect(childRect);
     1511    child2->invalidateContentRect(child2Rect);
    15121512    ccLayerTreeHost->updateLayers(updater, (3 * 2 + 3 * 1) * (100 * 100) * 4);
    15131513    {
     
    15431543    // for one of the children layers, but they draw into a surface that can't be
    15441544    // allocated.
    1545     root->invalidateRect(rootRect);
    1546     child->invalidateRect(childRect);
    1547     child2->invalidateRect(child2Rect);
     1545    root->invalidateContentRect(rootRect);
     1546    child->invalidateContentRect(childRect);
     1547    child2->invalidateContentRect(child2Rect);
    15481548    ccLayerTreeHost->updateLayers(updater, (3 * 1) * (100 * 100) * 4);
    15491549    {
     
    16341634    IntRect contentRect(0, 0, 45, 47);
    16351635    EXPECT_EQ(contentRect.size(), layer->contentBounds());
    1636     layer->setVisibleLayerRect(contentRect);
     1636    layer->setVisibleContentRect(contentRect);
    16371637
    16381638    layer->setTexturePriorities(calculator);
     
    16401640
    16411641    // Update the whole tile.
    1642     layer->updateLayerRect(updater, contentRect, 0);
     1642    layer->updateContentRect(updater, contentRect, 0);
    16431643    layer->trackingLayerPainter()->resetPaintedRect();
    16441644
     
    16481648
    16491649    // Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds.
    1650     layer->invalidateRect(contentRect);
    1651     layer->updateLayerRect(updater, contentRect, 0);
     1650    layer->invalidateContentRect(contentRect);
     1651    layer->updateContentRect(updater, contentRect, 0);
    16521652
    16531653    EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
     
    16671667
    16681668    IntRect contentRect(IntPoint(), layer->contentBounds());
    1669     layer->setVisibleLayerRect(contentRect);
     1669    layer->setVisibleContentRect(contentRect);
    16701670
    16711671    layer->setTexturePriorities(calculator);
     
    16731673
    16741674    // Update the whole tile.
    1675     layer->updateLayerRect(updater, contentRect, 0);
     1675    layer->updateContentRect(updater, contentRect, 0);
    16761676    layer->trackingLayerPainter()->resetPaintedRect();
    16771677
     
    16821682    // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
    16831683    layer->setNeedsDisplayRect(layerRect);
    1684     layer->updateLayerRect(updater, contentRect, 0);
     1684    layer->updateContentRect(updater, contentRect, 0);
    16851685
    16861686    EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
Note: See TracChangeset for help on using the changeset viewer.