Changeset 122373 in webkit
- Timestamp:
- Jul 11, 2012 2:38:43 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122372 r122373 1 2012-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 1 92 2012-07-11 Chris Fleizach <cfleizach@apple.com> 2 93 -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp
r121628 r122373 76 76 canvas->restore(); 77 77 78 opaqueLayerRect.scale(contentsWidthScale, contentsHeightScale); 79 resultingOpaqueRect = enclosedIntRect(opaqueLayerRect); 78 FloatRect opaqueContentRect = opaqueLayerRect; 79 opaqueContentRect.scale(contentsWidthScale, contentsHeightScale); 80 resultingOpaqueRect = enclosedIntRect(opaqueContentRect); 80 81 81 82 m_contentRect = contentRect; -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r122185 r122373 98 98 createTextureUpdaterIfNeeded(); 99 99 100 IntRect layerRect;100 IntRect contentRect; 101 101 102 // Always call update LayerRect() but with an empty layer rectangle when102 // Always call updateContentRect() but with an empty layer rectangle when 103 103 // layer doesn't draw contents. 104 104 if (drawsContent()) 105 layerRect = visibleLayerRect();105 contentRect = visibleContentRect(); 106 106 107 update LayerRect(updater, layerRect, occlusion);107 updateContentRect(updater, contentRect, occlusion); 108 108 m_needsDisplay = false; 109 109 } … … 113 113 if (!drawsContent()) 114 114 return false; 115 return needsIdlePaint(visible LayerRect());115 return needsIdlePaint(visibleContentRect()); 116 116 } 117 117 -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
r121574 r122373 156 156 m_textureUpdater->setBitmap(m_bitmap); 157 157 updateTileSizeAndTilingOption(); 158 invalidate Rect(IntRect(IntPoint(), contentBounds()));158 invalidateContentRect(IntRect(IntPoint(), contentBounds())); 159 159 m_needsDisplay = false; 160 160 } 161 161 162 update LayerRect(updater, visibleLayerRect(), occlusion);162 updateContentRect(updater, visibleContentRect(), occlusion); 163 163 } 164 164 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r121396 r122373 733 733 { 734 734 if (opaque()) 735 return visible LayerRect();735 return visibleContentRect(); 736 736 return Region(); 737 737 } -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r122185 r122373 155 155 bool transformIsAnimating() const; 156 156 157 const IntRect& visible LayerRect() const { return m_visibleLayerRect; }158 void setVisible LayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }157 const IntRect& visibleContentRect() const { return m_visibleContentRect; } 158 void setVisibleContentRect(const IntRect& visibleContentRect) { m_visibleContentRect = visibleContentRect; } 159 159 160 160 const IntRect& scissorRect() const { return m_scissorRect; } … … 345 345 346 346 // Uses layer's content space. 347 IntRect m_visible LayerRect;347 IntRect m_visibleContentRect; 348 348 349 349 // During drawing, identifies the region outside of which nothing should be drawn. -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r122306 r122373 611 611 return; 612 612 613 WebTransformationMatrix renderTransform = quad-> layerTransform();613 WebTransformationMatrix renderTransform = quad->drawTransform(); 614 614 // Apply a scaling factor to size the quad from 1x1 to its intended size. 615 615 renderTransform.scale3d(quad->quadRect().width(), quad->quadRect().height(), 1); … … 634 634 if (backgroundTexture) { 635 635 ASSERT(backgroundTexture->size() == quad->quadRect().size()); 636 copyTextureToFramebuffer(backgroundTexture->id(), quad->quadRect().size(), quad-> layerTransform());636 copyTextureToFramebuffer(backgroundTexture->id(), quad->quadRect().size(), quad->drawTransform()); 637 637 } 638 638 … … 716 716 ASSERT(!clipped); 717 717 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, 719 719 shaderMatrixLocation, shaderAlphaLocation, shaderQuadLocation); 720 720 } … … 808 808 809 809 bool clipped = false; 810 FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(quad-> layerRect()), clipped);810 FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(quad->visibleContentRect()), clipped); 811 811 ASSERT(!clipped); 812 812 … … 969 969 GLC(context(), context()->uniform3fv(program->fragmentShader().yuvAdjLocation(), 1, yuvAdjust)); 970 970 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); 976 977 977 978 // Reset active texture back to texture 0. … … 996 997 GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocation(), 0)); 997 998 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); 1003 1005 } 1004 1006 … … 1093 1095 GLC(context(), context()->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE)); 1094 1096 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); 1098 1102 1099 1103 GLC(context(), context()->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, 0)); -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r122294 r122373 157 157 Vector<IntRect> rects = newRegion.rects(); 158 158 for (size_t i = 0; i < rects.size(); ++i) 159 invalidate Rect(rects[i]);159 invalidateContentRect(rects[i]); 160 160 } 161 161 … … 289 289 scaledDirtyRect.scale(contentsWidthScale, contentsHeightScale); 290 290 IntRect dirty = enclosingIntRect(scaledDirtyRect); 291 invalidate Rect(dirty);291 invalidateContentRect(dirty); 292 292 LayerChromium::setNeedsDisplayRect(dirtyRect); 293 293 } … … 307 307 } 308 308 309 void TiledLayerChromium::invalidate Rect(const IntRect& layerRect)309 void TiledLayerChromium::invalidateContentRect(const IntRect& contentRect) 310 310 { 311 311 updateBounds(); 312 if (m_tiler->isEmpty() || layerRect.isEmpty() || m_skipsDraw)312 if (m_tiler->isEmpty() || contentRect.isEmpty() || m_skipsDraw) 313 313 return; 314 314 … … 320 320 continue; 321 321 IntRect bound = m_tiler->tileRect(tile); 322 bound.intersect( layerRect);322 bound.intersect(contentRect); 323 323 tile->dirtyRect.unite(bound); 324 324 } … … 357 357 // the dirty regions currently being drawn. All dirty tiles that are to be painted 358 358 // get their updateRect set to dirtyRect and dirtyRect cleared. This way if 359 // invalidate Rect is invoked during updateLayerRect we don't lose the request.359 // invalidateContentRect is invoked during updateContentRect we don't lose the request. 360 360 IntRect paintRect; 361 361 for (int j = top; j <= bottom; ++j) { … … 378 378 // If any part of the tile is visible, then we need to update it so the tile is pushed to the impl thread. 379 379 if (!idle && occlusion) { 380 IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visible LayerRect());380 IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleContentRect()); 381 381 if (occlusion->occluded(this, visibleTileRect)) { 382 382 ASSERT(!tile->updated); … … 518 518 void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priorityCalc) 519 519 { 520 setTexturePrioritiesInRect(priorityCalc, visible LayerRect());521 } 522 523 void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visible Rect)520 setTexturePrioritiesInRect(priorityCalc, visibleContentRect()); 521 } 522 523 void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visibleContentRect) 524 524 { 525 525 updateBounds(); 526 526 resetUpdateState(); 527 527 528 IntRect prepaintRect = idlePaintRect(visible Rect);528 IntRect prepaintRect = idlePaintRect(visibleContentRect); 529 529 bool drawsToRootSurface = !targetRenderSurface()->targetRenderSurface(); 530 530 … … 532 532 if (!prepaintRect.isEmpty()) { 533 533 int left, top, right, bottom; 534 m_tiler-> layerRectToTileIndices(prepaintRect, left, top, right, bottom);534 m_tiler->contentRectToTileIndices(prepaintRect, left, top, right, bottom); 535 535 for (int j = top; j <= bottom; ++j) 536 536 for (int i = left; i <= right; ++i) … … 543 543 // uploaded, swapped atomically via pushProperties, and finally deleted 544 544 // after the commit is complete, after which they can be recycled. 545 if (!visible Rect.isEmpty()) {545 if (!visibleContentRect.isEmpty()) { 546 546 int left, top, right, bottom; 547 m_tiler-> layerRectToTileIndices(visibleRect, left, top, right, bottom);547 m_tiler->contentRectToTileIndices(visibleContentRect, left, top, right, bottom); 548 548 for (int j = top; j <= bottom; ++j) { 549 549 for (int i = left; i <= right; ++i) { … … 582 582 // 512 pixels of pre-painting. Later we can just pass an animating flag etc. to the 583 583 // calculator and it can take care of this special case if we still need it. 584 if (visible Rect.isEmpty() && !prepaintRect.isEmpty())584 if (visibleContentRect.isEmpty() && !prepaintRect.isEmpty()) 585 585 tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(512, drawsToRootSurface)); 586 else if (!visible Rect.isEmpty())587 tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(visible Rect, tileRect, drawsToRootSurface));586 else if (!visibleContentRect.isEmpty()) 587 tile->managedTexture()->setRequestPriority(priorityCalc.priorityFromDistance(visibleContentRect, tileRect, drawsToRootSurface)); 588 588 } 589 589 } … … 594 594 return Region(); 595 595 if (opaque()) 596 return visible LayerRect();597 return m_tiler->opaqueRegionIn LayerRect(visibleLayerRect());596 return visibleContentRect(); 597 return m_tiler->opaqueRegionInContentRect(visibleContentRect()); 598 598 } 599 599 … … 612 612 } 613 613 614 void TiledLayerChromium::update LayerRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion)614 void TiledLayerChromium::updateContentRect(CCTextureUpdater& updater, const IntRect& contentRect, const CCOcclusionTracker* occlusion) 615 615 { 616 616 m_skipsDraw = false; … … 626 626 if (!contentRect.isEmpty()) { 627 627 int left, top, right, bottom; 628 m_tiler-> layerRectToTileIndices(contentRect, left, top, right, bottom);628 m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom); 629 629 updateTiles(false, left, top, right, bottom, updater, occlusion); 630 630 } … … 640 640 641 641 int prepaintLeft, prepaintTop, prepaintRight, prepaintBottom; 642 m_tiler-> layerRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom);642 m_tiler->contentRectToTileIndices(idlePaintContentRect, prepaintLeft, prepaintTop, prepaintRight, prepaintBottom); 643 643 644 644 // If the layer is not visible, we have nothing to expand from, so instead we prepaint the outer-most set of tiles. … … 658 658 659 659 int left, top, right, bottom; 660 m_tiler-> layerRectToTileIndices(contentRect, left, top, right, bottom);660 m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom); 661 661 662 662 // Otherwise, prepaint anything that was occluded but inside the layer's visible region. … … 694 694 } 695 695 696 bool TiledLayerChromium::needsIdlePaint(const IntRect& contentRect)696 bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect) 697 697 { 698 698 if (m_skipsIdlePaint) … … 702 702 return false; 703 703 704 IntRect idlePaintContentRect = idlePaintRect( contentRect);704 IntRect idlePaintContentRect = idlePaintRect(visibleContentRect); 705 705 if (idlePaintContentRect.isEmpty()) 706 706 return false; 707 707 708 708 int left, top, right, bottom; 709 m_tiler-> layerRectToTileIndices(idlePaintContentRect, left, top, right, bottom);709 m_tiler->contentRectToTileIndices(idlePaintContentRect, left, top, right, bottom); 710 710 711 711 for (int j = top; j <= bottom; ++j) { 712 712 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) 715 715 continue; 716 716 UpdatableTile* tile = tileAt(i, j); … … 729 729 } 730 730 731 IntRect TiledLayerChromium::idlePaintRect(const IntRect& visible Rect)731 IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleContentRect) 732 732 { 733 733 IntRect contentRect(IntPoint::zero(), contentBounds()); … … 736 736 // of them is going to become visible. For small layers we return the entire layer, for larger 737 737 // ones we avoid prepainting the layer at all. 738 if (visible Rect.isEmpty()) {738 if (visibleContentRect.isEmpty()) { 739 739 bool isSmallLayer = m_tiler->numTilesX() <= 9 && m_tiler->numTilesY() <= 9 && m_tiler->numTilesX() * m_tiler->numTilesY() <= 9; 740 740 if ((drawTransformIsAnimating() || screenSpaceTransformIsAnimating()) && isSmallLayer) … … 745 745 // FIXME: This can be made a lot larger now! We should increase 746 746 // this slowly while insuring it doesn't cause any perf issues. 747 IntRect prepaintRect = visible Rect;747 IntRect prepaintRect = visibleContentRect; 748 748 prepaintRect.inflateX(m_tiler->tileSize().width()); 749 749 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r122185 r122373 78 78 79 79 // Set invalidations to be potentially repainted during update(). 80 void invalidate Rect(const IntRect& layerRect);80 void invalidateContentRect(const IntRect& contentRect); 81 81 82 82 // Reset state on tiles that will be used for updating the layer. 83 83 void resetUpdateState(); 84 84 85 // Prepare data needed to update textures that intersect with layerRect.86 void update LayerRect(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*); 87 87 88 88 // After preparing an update, returns true if more painting is needed. 89 bool needsIdlePaint(const IntRect& layerRect);89 bool needsIdlePaint(const IntRect& visibleContentRect); 90 90 91 IntRect idlePaintRect(const IntRect& visible LayerRect);91 IntRect idlePaintRect(const IntRect& visibleContentRect); 92 92 93 93 bool skipsDraw() const { return m_skipsDraw; } … … 105 105 bool tileNeedsBufferedUpdate(UpdatableTile*); 106 106 107 void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visible LayerRect);107 void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleContentRect); 108 108 109 109 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 50 50 const IntRect& quadRect() const { return m_quadRect; } 51 51 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(); } 54 53 const IntRect& scissorRect() const { return m_sharedQuadState->scissorRect(); } 55 54 float opacity() const { return m_sharedQuadState->opacity(); } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r122160 r122373 148 148 PassOwnPtr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const 149 149 { 150 return CCSharedQuadState::create(quadTransform(), drawTransform(), visibleLayerRect(), m_scissorRect, drawOpacity(), opaque());150 return CCSharedQuadState::create(quadTransform(), m_visibleContentRect, m_scissorRect, m_drawOpacity, m_opaque); 151 151 } 152 152 … … 173 173 return; 174 174 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())); 177 177 } 178 178 … … 614 614 { 615 615 if (opaque()) 616 return visible LayerRect();616 return visibleContentRect(); 617 617 return Region(); 618 618 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r121396 r122373 228 228 CCInputHandlerClient::ScrollStatus tryScroll(const IntPoint& viewportPoint, CCInputHandlerClient::ScrollInputType) const; 229 229 230 const IntRect& visible LayerRect() const { return m_visibleLayerRect; }231 void setVisible LayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }230 const IntRect& visibleContentRect() const { return m_visibleContentRect; } 231 void setVisibleContentRect(const IntRect& visibleContentRect) { m_visibleContentRect = visibleContentRect; } 232 232 233 233 bool doubleSided() const { return m_doubleSided; } … … 333 333 334 334 // Uses layer's content space. 335 IntRect m_visible LayerRect;335 IntRect m_visibleContentRect; 336 336 bool m_masksToBounds; 337 337 bool m_opaque; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
r116359 r122373 100 100 } 101 101 102 void CCLayerTilingData:: layerRectToTileIndices(const IntRect& layerRect, int& left, int& top, int& right, int& bottom) const102 void CCLayerTilingData::contentRectToTileIndices(const IntRect& contentRect, int& left, int& top, int& right, int& bottom) const 103 103 { 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); 108 108 } 109 109 … … 115 115 } 116 116 117 Region CCLayerTilingData::opaqueRegionIn LayerRect(const IntRect& layerRect) const117 Region CCLayerTilingData::opaqueRegionInContentRect(const IntRect& contentRect) const 118 118 { 119 if ( layerRect.isEmpty())119 if (contentRect.isEmpty()) 120 120 return Region(); 121 121 122 122 Region opaqueRegion; 123 123 int left, top, right, bottom; 124 layerRectToTileIndices(layerRect, left, top, right, bottom);124 contentRectToTileIndices(contentRect, left, top, right, bottom); 125 125 for (int j = top; j <= bottom; ++j) { 126 126 for (int i = left; i <= right; ++i) { … … 129 129 continue; 130 130 131 IntRect tileOpaqueRect = intersection( layerRect, tile->opaqueRect());131 IntRect tileOpaqueRect = intersection(contentRect, tile->opaqueRect()); 132 132 opaqueRegion.unite(tileOpaqueRect); 133 133 } … … 142 142 // Any tiles completely outside our new bounds are invalid and should be dropped. 143 143 int left, top, right, bottom; 144 layerRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom);144 contentRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom); 145 145 Vector<TileMapKey> invalidTileKeys; 146 146 for (TileMap::const_iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
r116359 r122373 99 99 IntSize bounds() const; 100 100 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; 102 102 IntRect tileRect(const Tile*) const; 103 103 104 Region opaqueRegionIn LayerRect(const IntRect&) const;104 Region opaqueRegionInContentRect(const IntRect&) const; 105 105 106 106 void reset(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
r122120 r122373 154 154 155 155 template<typename LayerType> 156 static IntRect calculateVisible LayerRect(LayerType* layer)156 static IntRect calculateVisibleContentRect(LayerType* layer) 157 157 { 158 158 ASSERT(layer->targetRenderSurface()); … … 177 177 transform.translate(-contentBounds.width() / 2.0, -contentBounds.height() / 2.0); 178 178 179 IntRect visible LayerRect = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerBoundRect, transform);180 return visible LayerRect;179 IntRect visibleContentRect = CCLayerTreeHostCommon::calculateVisibleRect(targetSurfaceRect, layerBoundRect, transform); 180 return visibleContentRect; 181 181 } 182 182 … … 220 220 // Some additional conditions need to be computed at a later point after the recursion is finished. 221 221 // - the intersection of render surface content and layer clipRect is empty 222 // - the visible LayerRect is empty222 // - the visibleContentRect is empty 223 223 // 224 224 // Note, if the layer should not have been drawn due to being fully transparent, … … 834 834 835 835 // FIXME: Instead of using the following function to set visibility rects on a second 836 // tree pass, revise calculateVisible LayerRect() so that this can be done in a single836 // tree pass, revise calculateVisibleContentRect() so that this can be done in a single 837 837 // pass inside calculateDrawTransformsInternal<>(). 838 838 template<typename LayerType, typename LayerList, typename RenderSurfaceType> … … 847 847 LayerType* maskLayer = it->maskLayer(); 848 848 if (maskLayer) 849 maskLayer->setVisible LayerRect(IntRect(IntPoint(), it->contentBounds()));849 maskLayer->setVisibleContentRect(IntRect(IntPoint(), it->contentBounds())); 850 850 LayerType* replicaMaskLayer = it->replicaLayer() ? it->replicaLayer()->maskLayer() : 0; 851 851 if (replicaMaskLayer) 852 replicaMaskLayer->setVisible LayerRect(IntRect(IntPoint(), it->contentBounds()));852 replicaMaskLayer->setVisibleContentRect(IntRect(IntPoint(), it->contentBounds())); 853 853 } else if (it.representsItself()) { 854 IntRect visible LayerRect = calculateVisibleLayerRect(*it);855 it->setVisible LayerRect(visibleLayerRect);854 IntRect visibleContentRect = calculateVisibleContentRect(*it); 855 it->setVisibleContentRect(visibleContentRect); 856 856 857 857 IntRect scissorRect = calculateLayerScissorRect<LayerType, RenderSurfaceType>(*it, rootScissorRect); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r122360 r122373 330 330 CCRenderPass* contributingRenderPass = surfacePassMap.get(it->renderSurface()); 331 331 pass->appendQuadsForRenderSurfaceLayer(*it, contributingRenderPass, &occlusionTracker); 332 } else if (it.representsItself() && !occlusionTracker.occluded(*it, it->visible LayerRect()) && !it->visibleLayerRect().isEmpty() && !it->scissorRect().isEmpty()) {332 } else if (it.representsItself() && !occlusionTracker.occluded(*it, it->visibleContentRect()) && !it->visibleContentRect().isEmpty() && !it->scissorRect().isEmpty()) { 333 333 it->willDraw(m_layerRenderer.get(), context()); 334 334 frame.willDrawLayers.append(*it); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
r121583 r122373 311 311 static inline void addOcclusionBehindLayer(Region& region, const LayerType* layer, const WebTransformationMatrix& transform, const Region& opaqueContents, const IntRect& scissorRect, const IntSize& minimumTrackingSize, Vector<IntRect>* occludingScreenSpaceRects) 312 312 { 313 ASSERT(layer->visible LayerRect().contains(opaqueContents.bounds()));313 ASSERT(layer->visibleContentRect().contains(opaqueContents.bounds())); 314 314 315 315 bool clipped; 316 FloatQuad visibleTransformedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visible LayerRect()), clipped);316 FloatQuad visibleTransformedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleContentRect()), clipped); 317 317 // FIXME: Find a rect interior to each transformed quad. 318 318 if (clipped || !visibleTransformedQuad.isRectilinear()) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp
r122160 r122373 32 32 namespace WebCore { 33 33 34 PassOwnPtr<CCRenderPassDrawQuad> CCRenderPassDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::Web FilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)34 PassOwnPtr<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) 35 35 { 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)); 37 37 } 38 38 39 CCRenderPassDrawQuad::CCRenderPassDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const CCRenderPass* renderPass, bool isReplica, const WebKit::Web FilterOperations& filters, const WebKit::WebFilterOperations& backgroundFilters, unsigned maskTextureId, const IntRect& contentsChangedSinceLastFrame)39 CCRenderPassDrawQuad::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) 40 40 : CCDrawQuad(sharedQuadState, CCDrawQuad::RenderPass, quadRect) 41 41 , m_renderPass(renderPass) 42 42 , m_renderPassId(renderPass->id()) 43 43 , m_isReplica(isReplica) 44 , m_drawTransform(drawTransform) 44 45 , m_filters(filters) 45 46 , m_backgroundFilters(backgroundFilters) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h
r122160 r122373 29 29 #include "cc/CCDrawQuad.h" 30 30 #include <public/WebFilterOperations.h> 31 #include <public/WebTransformationMatrix.h> 31 32 #include <wtf/PassOwnPtr.h> 32 33 … … 38 39 WTF_MAKE_NONCOPYABLE(CCRenderPassDrawQuad); 39 40 public: 40 static PassOwnPtr<CCRenderPassDrawQuad> create(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::Web FilterOperations& 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); 41 42 42 43 const CCRenderPass* renderPass() const { return m_renderPass; } … … 46 47 const IntRect& contentsChangedSinceLastFrame() const { return m_contentsChangedSinceLastFrame; } 47 48 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 48 52 const WebKit::WebFilterOperations& filters() const { return m_filters; } 49 53 const WebKit::WebFilterOperations& backgroundFilters() const { return m_backgroundFilters; } 50 54 51 55 private: 52 CCRenderPassDrawQuad(const CCSharedQuadState*, const IntRect&, const CCRenderPass*, bool isReplica, const WebKit::Web FilterOperations& 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); 53 57 54 58 const CCRenderPass* m_renderPass; 55 59 int m_renderPassId; 56 60 bool m_isReplica; 61 WebKit::WebTransformationMatrix m_drawTransform; 57 62 WebKit::WebFilterOperations m_filters; 58 63 WebKit::WebFilterOperations m_backgroundFilters; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp
r122160 r122373 189 189 { 190 190 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); 192 192 } 193 193 … … 195 195 { 196 196 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); 198 198 } 199 199 … … 233 233 234 234 int maskTextureId = maskLayer ? maskLayer->contentsTextureId() : 0; 235 WebTransformationMatrix drawTransform = forReplica ? m_replicaDrawTransform : m_drawTransform; 235 236 IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : IntRect(); 236 237 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)); 238 239 } 239 240 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.cpp
r121583 r122373 34 34 namespace WebCore { 35 35 36 PassOwnPtr<CCSharedQuadState> CCSharedQuadState::create(const WebTransformationMatrix& quadTransform, const WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque)36 PassOwnPtr<CCSharedQuadState> CCSharedQuadState::create(const WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque) 37 37 { 38 return adoptPtr(new CCSharedQuadState(quadTransform, layerTransform, layerRect, scissorRect, opacity, opaque));38 return adoptPtr(new CCSharedQuadState(quadTransform, visibleContentRect, scissorRect, opacity, opaque)); 39 39 } 40 40 41 CCSharedQuadState::CCSharedQuadState(const WebTransformationMatrix& quadTransform, const WebTransformationMatrix& layerTransform, const IntRect& layerRect, const IntRect& scissorRect, float opacity, bool opaque)41 CCSharedQuadState::CCSharedQuadState(const WebTransformationMatrix& quadTransform, const IntRect& visibleContentRect, const IntRect& scissorRect, float opacity, bool opaque) 42 42 : m_quadTransform(quadTransform) 43 , m_layerTransform(layerTransform) 44 , m_layerRect(layerRect) 43 , m_visibleContentRect(visibleContentRect) 45 44 , m_scissorRect(scissorRect) 46 45 , m_opacity(opacity) … … 54 53 // Assume that they're orthonormal and have integer scales and translations. 55 54 bool clipped = false; 56 FloatQuad quad = CCMathUtil::mapQuad(quadTransform(), FloatQuad( layerRect()), clipped);55 FloatQuad quad = CCMathUtil::mapQuad(quadTransform(), FloatQuad(visibleContentRect()), clipped); 57 56 return !clipped && quad.isRectilinear() && quad.boundingBox().isExpressibleAsIntRect(); 58 57 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSharedQuadState.h
r119401 r122373 37 37 WTF_MAKE_NONCOPYABLE(CCSharedQuadState); 38 38 public: 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); 40 40 41 // T he 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. 42 42 const WebKit::WebTransformationMatrix& quadTransform() const { return m_quadTransform; } 43 // Th e 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. 46 46 const IntRect& scissorRect() const { return m_scissorRect; } 47 47 … … 51 51 52 52 private: 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); 54 54 55 55 WebKit::WebTransformationMatrix m_quadTransform; 56 WebKit::WebTransformationMatrix m_layerTransform; 57 IntRect m_layerRect; 56 IntRect m_visibleContentRect; 58 57 IntRect m_scissorRect; 59 58 float m_opacity; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
r122160 r122373 143 143 void CCTiledLayerImpl::appendQuads(CCQuadCuller& quadList, const CCSharedQuadState* sharedQuadState, bool& hadMissingTiles) 144 144 { 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()) 148 148 return; 149 149 150 150 int left, top, right, bottom; 151 m_tiler-> layerRectToTileIndices(layerRect, left, top, right, bottom);151 m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom); 152 152 153 153 if (hasDebugBorders()) { … … 175 175 IntRect tileRect = m_tiler->tileBounds(i, j); 176 176 IntRect displayRect = tileRect; 177 tileRect.intersect( layerRect);177 tileRect.intersect(contentRect); 178 178 179 179 // Skip empty tiles. … … 190 190 191 191 IntRect tileOpaqueRect = tile->opaqueRect(); 192 tileOpaqueRect.intersect( layerRect);192 tileOpaqueRect.intersect(contentRect); 193 193 194 194 // Keep track of how the top left has moved, so the texture can be … … 236 236 return Region(); 237 237 if (opaque()) 238 return visible LayerRect();239 return m_tiler->opaqueRegionIn LayerRect(visibleLayerRect());238 return visibleContentRect(); 239 return m_tiler->opaqueRegionInContentRect(visibleContentRect()); 240 240 } 241 241 -
trunk/Source/WebKit/chromium/ChangeLog
r122360 r122373 1 2012-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 1 34 2012-07-11 Dana Jansens <danakj@chromium.org> 2 35 -
trunk/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
r121396 r122373 176 176 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawableContentRect(arbitraryIntRect)); 177 177 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setUpdateRect(arbitraryFloatRect)); 178 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisible LayerRect(arbitraryIntRect));178 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisibleContentRect(arbitraryIntRect)); 179 179 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMaxScrollPosition(arbitraryIntSize)); 180 180 } -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
r122120 r122373 2845 2845 EXPECT_EQ(childOfAnimatingSurface->id(), renderSurfaceLayerList[1]->renderSurface()->layerList()[1]->id()); 2846 2846 2847 EXPECT_FALSE(child2->visible LayerRect().isEmpty());2848 2849 // The animating layers should have a visible LayerRect that represents the area of the front face that is within the viewport.2850 EXPECT_EQ(animatingChild->visible LayerRect(), IntRect(IntPoint(), animatingChild->contentBounds()));2851 EXPECT_EQ(animatingSurface->visible LayerRect(), IntRect(IntPoint(), animatingSurface->contentBounds()));2852 // And layers in the subtree of the animating layer should have valid visible LayerRects also.2853 EXPECT_EQ(childOfAnimatingSurface->visible LayerRect(), 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())); 2854 2854 } 2855 2855 … … 3209 3209 TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents) 3210 3210 { 3211 // A layer's visible LayerRect is actually in the layer's content space. The3211 // A layer's visibleContentRect is actually in the layer's content space. The 3212 3212 // screenSpaceTransform converts from the layer's origin space to screen space. This 3213 3213 // test makes sure that hit testing works correctly accounts for the contents scale. … … 3217 3217 // 3218 3218 // 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 visible LayerRect3219 // contentsScale is ignored, then hit testing will mis-interpret the visibleContentRect 3220 3220 // as being larger than the actual bounds of the layer. 3221 3221 // … … 3243 3243 3244 3244 // Sanity check the scenario we just created. 3245 // The visible LayerRect 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->visible LayerRect());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()); 3247 3247 ASSERT_EQ(1u, renderSurfaceLayerList.size()); 3248 3248 ASSERT_EQ(1u, root->renderSurface()->layerList().size()); … … 3419 3419 // (4, 50) is inside the unclipped layer, but that corner of the layer should be 3420 3420 // clipped away by the grandParent and should not get hit. If hit testing blindly uses 3421 // visible LayerRect without considering how parent may clip the layer, then hit3421 // visibleContentRect without considering how parent may clip the layer, then hit 3422 3422 // testing would accidentally think that the point successfully hits the layer. 3423 3423 testPoint = IntPoint(4, 50); -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
r122360 r122373 102 102 root->setBounds(IntSize(10, 10)); 103 103 root->setContentBounds(IntSize(10, 10)); 104 root->setVisible LayerRect(IntRect(0, 0, 10, 10));104 root->setVisibleContentRect(IntRect(0, 0, 10, 10)); 105 105 root->setDrawsContent(true); 106 106 myHostImpl->setRootLayer(root.release()); … … 630 630 setDrawsContent(true); 631 631 setSkipsDraw(false); 632 setVisible LayerRect(IntRect(0, 0, 10, 10));632 setVisibleContentRect(IntRect(0, 0, 10, 10)); 633 633 634 634 OwnPtr<CCLayerTilingData> tiler = CCLayerTilingData::create(IntSize(100, 100), CCLayerTilingData::HasBorderTexels); … … 652 652 root->addChild(DidDrawCheckLayer::create(2)); 653 653 DidDrawCheckLayer* layer = static_cast<DidDrawCheckLayer*>(root->children()[0].get()); 654 // Ensure visible LayerRect for layer is empty654 // Ensure visibleContentRect for layer is empty 655 655 layer->setPosition(FloatPoint(100, 100)); 656 656 layer->setBounds(IntSize(10, 10)); … … 669 669 EXPECT_FALSE(layer->didDrawCalled()); 670 670 671 EXPECT_TRUE(layer->visible LayerRect().isEmpty());672 673 // Ensure visible LayerRect for layer layer is not empty671 EXPECT_TRUE(layer->visibleContentRect().isEmpty()); 672 673 // Ensure visibleContentRect for layer layer is not empty 674 674 layer->setPosition(FloatPoint(0, 0)); 675 675 … … 684 684 EXPECT_TRUE(layer->didDrawCalled()); 685 685 686 EXPECT_FALSE(layer->visible LayerRect().isEmpty());686 EXPECT_FALSE(layer->visibleContentRect().isEmpty()); 687 687 } 688 688 … … 1859 1859 root->setBounds(IntSize(rootRect.width(), rootRect.height())); 1860 1860 root->setContentBounds(root->bounds()); 1861 root->setVisible LayerRect(rootRect);1861 root->setVisibleContentRect(rootRect); 1862 1862 root->setDrawsContent(false); 1863 1863 root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height()))); … … 1868 1868 child->setBounds(IntSize(childRect.width(), childRect.height())); 1869 1869 child->setContentBounds(child->bounds()); 1870 child->setVisible LayerRect(childRect);1870 child->setVisibleContentRect(childRect); 1871 1871 child->setDrawsContent(false); 1872 1872 … … 1875 1875 grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height())); 1876 1876 grandChild->setContentBounds(grandChild->bounds()); 1877 grandChild->setVisible LayerRect(grandChildRect);1877 grandChild->setVisibleContentRect(grandChildRect); 1878 1878 grandChild->setDrawsContent(true); 1879 1879 … … 2424 2424 root->setBounds(rootSize); 2425 2425 root->setContentBounds(rootSize); 2426 root->setVisible LayerRect(IntRect(IntPoint(0, 0), rootSize));2426 root->setVisibleContentRect(IntRect(IntPoint(0, 0), rootSize)); 2427 2427 root->setDrawsContent(true); 2428 2428 layerTreeHostImpl->setRootLayer(root.release()); … … 2436 2436 intermediateLayerPtr->setBounds(rootSize); 2437 2437 intermediateLayerPtr->setContentBounds(rootSize); 2438 intermediateLayerPtr->setVisible LayerRect(IntRect(IntPoint(0, 0), rootSize));2438 intermediateLayerPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), rootSize)); 2439 2439 intermediateLayerPtr->setDrawsContent(false); // only children draw content 2440 2440 rootPtr->addChild(intermediateLayer.release()); … … 2450 2450 surfaceLayerPtr->setBounds(surfaceSize); 2451 2451 surfaceLayerPtr->setContentBounds(surfaceSize); 2452 surfaceLayerPtr->setVisible LayerRect(IntRect(IntPoint(0, 0), surfaceSize));2452 surfaceLayerPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), surfaceSize)); 2453 2453 surfaceLayerPtr->setDrawsContent(false); // only children draw content 2454 2454 surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface … … 2464 2464 childPtr->setBounds(childSize); 2465 2465 childPtr->setContentBounds(childSize); 2466 childPtr->setVisible LayerRect(IntRect(IntPoint(0, 0), childSize));2466 childPtr->setVisibleContentRect(IntRect(IntPoint(0, 0), childSize)); 2467 2467 childPtr->setDrawsContent(true); 2468 2468 … … 2947 2947 2948 2948 // 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); 2950 2950 2951 2951 const char* currentChar = testScript; … … 3016 3016 IntRect quadRect = IntRect(0, 0, 1, 1); 3017 3017 IntRect contentsChangedRect = contentsChanged ? quadRect : IntRect(); 3018 OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, refRenderPassPtr, isReplica, WebKit::Web FilterOperations(), WebKit::WebFilterOperations(), 1, contentsChangedRect);3018 OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, refRenderPassPtr, isReplica, WebKit::WebTransformationMatrix(), WebKit::WebFilterOperations(), WebKit::WebFilterOperations(), 1, contentsChangedRect); 3019 3019 static_cast<CCTestRenderPass*>(renderPass.get())->appendQuad(quad.release()); 3020 3020 } -
trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
r122160 r122373 63 63 { 64 64 if (m_overrideOpaqueContentsRect) 65 return intersection(m_opaqueContentsRect, visible LayerRect());65 return intersection(m_opaqueContentsRect, visibleContentRect()); 66 66 return LayerChromium::visibleContentOpaqueRegion(); 67 67 } … … 89 89 { 90 90 if (m_overrideOpaqueContentsRect) 91 return intersection(m_opaqueContentsRect, visible LayerRect());91 return intersection(m_opaqueContentsRect, visibleContentRect()); 92 92 return CCLayerImpl::visibleContentOpaqueRegion(); 93 93 } … … 760 760 EXPECT_INT_RECT_EQ(IntRect(9, 430, 60, 80), occlusion.unoccludedContentRect(child, IntRect(9, 430, 60, 80))); 761 761 // 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 visible LayerRect().762 // This also demonstrates that the rect can be arbitrary and does not get clipped to the layer's visibleContentRect(). 763 763 EXPECT_INT_RECT_EQ(IntRect(-10, 430, 20, 70), occlusion.unoccludedContentRect(child, IntRect(-10, 430, 60, 70))); 764 764 // This extends past three adjacent sides of child2, so it should contain the unoccluded parts of each side. The left … … 870 870 occlusion.setLayerScissorRect(IntRect(0, 0, 1000, 1000)); 871 871 872 IntRect clippedLayerInChild = CCMathUtil::mapClippedRect(layerTransform, layer->visible LayerRect());872 IntRect clippedLayerInChild = CCMathUtil::mapClippedRect(layerTransform, layer->visibleContentRect()); 873 873 874 874 this->visitLayer(layer, occlusion); … … 2025 2025 TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000)); 2026 2026 2027 // This is very close to the camera, so pixels in its visible LayerRect 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. 2028 2028 // Ensure that those pixels don't occlude things outside the clipRect. 2029 2029 this->visitLayer(layer, occlusion); -
trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
r122160 r122373 68 68 layer->setDrawTransform(drawTransform); 69 69 layer->setScreenSpaceTransform(drawTransform); 70 layer->setVisible LayerRect(layerRect);70 layer->setVisibleContentRect(layerRect); 71 71 layer->setDrawOpacity(opacity); 72 72 layer->setOpaque(opaque); -
trunk/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
r122160 r122373 103 103 IntRect contentRect = IntRect(IntPoint::zero(), IntSize(50, 50)); 104 104 IntRect clipRect = IntRect(IntPoint(5, 5), IntSize(40, 40)); 105 WebTransformationMatrix draw;106 105 WebTransformationMatrix origin; 107 106 108 draw.translate(30, 40);107 origin.translate(30, 40); 109 108 110 renderSurface->setDrawTransform(draw);111 109 renderSurface->setOriginTransform(origin); 112 110 renderSurface->setContentRect(contentRect); … … 117 115 OwnPtr<CCSharedQuadState> sharedQuadState = renderSurface->createSharedQuadState(); 118 116 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()); 123 120 EXPECT_EQ(clipRect, sharedQuadState->scissorRect()); 124 121 EXPECT_EQ(1, sharedQuadState->opacity()); -
trunk/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp
r122160 r122373 46 46 MockCCQuadCuller quadCuller; 47 47 IntSize layerSize = IntSize(800, 600); 48 IntRect visible LayerRect = IntRect(IntPoint(), layerSize);48 IntRect visibleContentRect = IntRect(IntPoint(), layerSize); 49 49 50 50 OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1); 51 layer->setVisible LayerRect(visibleLayerRect);51 layer->setVisibleContentRect(visibleContentRect); 52 52 layer->setBounds(layerSize); 53 53 … … 56 56 layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); 57 57 58 verifyQuadsExactlyCoverRect(quadCuller.quadList(), visible LayerRect);58 verifyQuadsExactlyCoverRect(quadCuller.quadList(), visibleContentRect); 59 59 } 60 60 … … 67 67 MockCCQuadCuller quadCuller; 68 68 IntSize layerSize = IntSize(100, 100); 69 IntRect visible LayerRect = IntRect(IntPoint(), layerSize);69 IntRect visibleContentRect = IntRect(IntPoint(), layerSize); 70 70 71 71 OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1); 72 layer->setVisible LayerRect(visibleLayerRect);72 layer->setVisibleContentRect(visibleContentRect); 73 73 layer->setBounds(layerSize); 74 74 layer->setBackgroundColor(testColor); … … 90 90 MockCCQuadCuller quadCuller; 91 91 IntSize layerSize = IntSize(100, 100); 92 IntRect visible LayerRect = IntRect(IntPoint(), layerSize);92 IntRect visibleContentRect = IntRect(IntPoint(), layerSize); 93 93 94 94 OwnPtr<CCSolidColorLayerImpl> layer = CCSolidColorLayerImpl::create(1); 95 layer->setVisible LayerRect(visibleLayerRect);95 layer->setVisibleContentRect(visibleContentRect); 96 96 layer->setBounds(layerSize); 97 97 layer->setDrawOpacity(opacity); -
trunk/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp
r122160 r122373 49 49 layer->setTilingData(*tiler); 50 50 layer->setSkipsDraw(false); 51 layer->setVisible LayerRect(IntRect(IntPoint(), layerSize));51 layer->setVisibleContentRect(IntRect(IntPoint(), layerSize)); 52 52 layer->setDrawOpacity(1); 53 53 … … 83 83 { 84 84 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); 85 layer->setVisible LayerRect(IntRect());85 layer->setVisibleContentRect(IntRect()); 86 86 87 87 MockCCQuadCuller quadCuller; … … 97 97 98 98 IntRect outsideBounds(IntPoint(-100, -100), IntSize(50, 50)); 99 layer->setVisible LayerRect(outsideBounds);99 layer->setVisibleContentRect(outsideBounds); 100 100 101 101 MockCCQuadCuller quadCuller; … … 159 159 } 160 160 161 static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visible LayerRect)161 static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleContentRect) 162 162 { 163 163 OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption); 164 layer->setVisible LayerRect(visibleLayerRect);164 layer->setVisibleContentRect(visibleContentRect); 165 165 layer->setBounds(layerSize); 166 166 … … 202 202 IntPoint topLeft(65, 73); 203 203 IntPoint bottomRight(182, 198); 204 IntRect visible LayerRect(topLeft, bottomRight - topLeft);204 IntRect visibleContentRect(topLeft, bottomRight - topLeft); 205 205 206 206 IntSize layerSize(250, 250); 207 207 CCQuadList quads; 208 208 OwnPtr<CCSharedQuadState> sharedState; 209 sharedState = getQuads(quads, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visible LayerRect);210 verifyQuadsExactlyCoverRect(quads, visible LayerRect);209 sharedState = getQuads(quads, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visibleContentRect); 210 verifyQuadsExactlyCoverRect(quads, visibleContentRect); 211 211 } 212 212 WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsTiles); … … 217 217 218 218 IntSize layerSize(220, 210); 219 IntRect visible LayerRect(IntPoint(), layerSize);220 CCQuadList quads; 221 OwnPtr<CCSharedQuadState> sharedState; 222 sharedState = getQuads(quads, IntSize(100, 100), layerSize, CCLayerTilingData::NoBorderTexels, visible LayerRect);223 verifyQuadsExactlyCoverRect(quads, visible LayerRect);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); 224 224 } 225 225 WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsBounds); -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
r121870 r122373 69 69 m_lastUpdateRect = contentRect; 70 70 if (!m_rectToInvalidate.isEmpty()) { 71 m_layer->invalidate Rect(m_rectToInvalidate);71 m_layer->invalidateContentRect(m_rectToInvalidate); 72 72 m_rectToInvalidate = IntRect(); 73 73 m_layer = 0; … … 119 119 void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion) 120 120 { 121 update LayerRect(updater, visibleLayerRect(), occlusion);121 updateContentRect(updater, visibleContentRect(), occlusion); 122 122 } 123 123 -
trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
r122185 r122373 111 111 static WebCore::IntSize tileSize() { return WebCore::IntSize(100, 100); } 112 112 113 using WebCore::TiledLayerChromium::invalidate Rect;114 using WebCore::TiledLayerChromium::update LayerRect;113 using WebCore::TiledLayerChromium::invalidateContentRect; 114 using WebCore::TiledLayerChromium::updateContentRect; 115 115 using WebCore::TiledLayerChromium::needsIdlePaint; 116 116 using WebCore::TiledLayerChromium::skipsDraw; … … 121 121 const WebCore::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; } 122 122 123 // Updates the visible LayerRect().123 // Updates the visibleContentRect(). 124 124 virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*) OVERRIDE; 125 125 -
trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
r121628 r122373 495 495 496 496 // Test properties that should not call needsDisplay and needsCommit when changed. 497 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisible LayerRect(IntRect(0, 0, 40, 50)));497 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContentRect(IntRect(0, 0, 40, 50))); 498 498 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUsesLayerClipping(true)); 499 499 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setIsNonCompositedContent(true)); -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r122185 r122373 102 102 // The tile size is 100x100, so this invalidates and then paints two tiles. 103 103 layer->setBounds(IntSize(100, 200)); 104 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));105 layer->invalidate Rect(IntRect(0, 0, 100, 200));106 107 layer->setTexturePriorities(priorityCalculator); 108 textureManager->prioritizeTextures(0); 109 110 layer->update LayerRect(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); 111 111 updateTextures(); 112 112 layer->pushPropertiesTo(layerImpl.get()); … … 117 117 118 118 // Invalidates both tiles... 119 layer->invalidate Rect(IntRect(0, 0, 100, 200));119 layer->invalidateContentRect(IntRect(0, 0, 100, 200)); 120 120 // ....but then only update one of them. 121 121 layer->setTexturePriorities(priorityCalculator); 122 122 textureManager->prioritizeTextures(0); 123 layer->update LayerRect(updater, IntRect(0, 0, 100, 100), 0);123 layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0); 124 124 layer->pushPropertiesTo(layerImpl.get()); 125 125 … … 141 141 layer->setBounds(IntSize(100, 200)); 142 142 layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0)); 143 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));144 layer->invalidate Rect(IntRect(0, 0, 100, 200));145 146 layer->setTexturePriorities(priorityCalculator); 147 textureManager->prioritizeTextures(0); 148 149 layer->update LayerRect(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); 150 150 updateTextures(); 151 151 layer->pushPropertiesTo(layerImpl.get()); … … 160 160 161 161 // Invalidates part of the top tile... 162 layer->invalidate Rect(IntRect(0, 0, 50, 50));162 layer->invalidateContentRect(IntRect(0, 0, 50, 50)); 163 163 // ....but the area is occluded. 164 164 occluded.setOcclusion(IntRect(0, 0, 50, 50)); 165 layer->update LayerRect(updater, IntRect(0, 0, 100, 100), &occluded);165 layer->updateContentRect(updater, IntRect(0, 0, 100, 100), &occluded); 166 166 updateTextures(); 167 167 layer->pushPropertiesTo(layerImpl.get()); … … 185 185 // The tile size is 100x100, so this invalidates and then paints two tiles. 186 186 layer->setBounds(IntSize(100, 200)); 187 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));188 layer->invalidate Rect(IntRect(0, 0, 100, 200));189 190 layer->setTexturePriorities(priorityCalculator); 191 textureManager->prioritizeTextures(0); 192 193 layer->update LayerRect(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); 194 194 updateTextures(); 195 195 layer->pushPropertiesTo(layerImpl.get()); … … 213 213 layer->setTexturePriorities(priorityCalculator); 214 214 textureManager->prioritizeTextures(0); 215 layer->update LayerRect(updater, IntRect(0, 0, 100, 100), 0);215 layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0); 216 216 updateTextures(); 217 217 layer->pushPropertiesTo(layerImpl.get()); … … 236 236 // This invalidates 25 tiles and then paints one visible tile. 237 237 layer->setBounds(contentBounds); 238 layer->setVisible LayerRect(visibleRect);239 layer->invalidate Rect(contentRect);240 241 layer->setTexturePriorities(priorityCalculator); 242 textureManager->prioritizeTextures(0); 243 244 layer->update LayerRect(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); 245 245 updateTextures(); 246 246 … … 258 258 textureManager->prioritizeTextures(0); 259 259 260 layer->update LayerRect(updater, visibleRect, 0);260 layer->updateContentRect(updater, visibleRect, 0); 261 261 EXPECT_TRUE(layer->needsIdlePaint(visibleRect)); 262 262 updateTextures(); … … 296 296 IntRect layer2Rect(0, 0, 100, 300); 297 297 layer2->setBounds(layer2Rect.size()); 298 layer2->setVisible LayerRect(layer2Rect);299 layer2->invalidate Rect(layer2Rect);298 layer2->setVisibleContentRect(layer2Rect); 299 layer2->invalidateContentRect(layer2Rect); 300 300 301 301 // This uses 960000 bytes, leaving 88576 bytes of memory left, which is enough for 2 tiles only in the other layer. 302 302 IntRect layerRect(IntPoint::zero(), IntSize(100, 2400)); 303 303 layer1->setBounds(layerRect.size()); 304 layer1->setVisible LayerRect(layerRect);305 layer1->invalidate Rect(layerRect);304 layer1->setVisibleContentRect(layerRect); 305 layer1->invalidateContentRect(layerRect); 306 306 307 307 // Paint a single tile in layer2 so that it will idle paint. … … 309 309 layer1->setTexturePriorities(priorityCalculator); 310 310 textureManager->prioritizeTextures(0); 311 layer1->update LayerRect(updater, layerRect, 0);312 layer2->update LayerRect(updater, IntRect(0, 0, 100, 100), 0);311 layer1->updateContentRect(updater, layerRect, 0); 312 layer2->updateContentRect(updater, IntRect(0, 0, 100, 100), 0); 313 313 314 314 // We should need idle-painting for both remaining tiles in layer2. … … 327 327 layer1->setTexturePriorities(priorityCalculator); 328 328 textureManager->prioritizeTextures(0); 329 layer2->update LayerRect(updater, IntRect(0, 0, 100, 100), 0);329 layer2->updateContentRect(updater, IntRect(0, 0, 100, 100), 0); 330 330 331 331 // Oh well, commit the frame and push. … … 347 347 layer1->setTexturePriorities(priorityCalculator); 348 348 textureManager->prioritizeTextures(0); 349 layer2->update LayerRect(updater, layer2Rect, 0);350 layer1->update LayerRect(updater, layerRect, 0);349 layer2->updateContentRect(updater, layer2Rect, 0); 350 layer1->updateContentRect(updater, layerRect, 0); 351 351 352 352 updateTextures(); … … 375 375 layer->setBounds(IntSize(100, 100)); 376 376 layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0)); 377 layer->setVisible LayerRect(IntRect(0, 0, 100, 100));378 layer->invalidate Rect(IntRect(0, 0, 100, 100));379 380 layer->setTexturePriorities(priorityCalculator); 381 textureManager->prioritizeTextures(0); 382 layer->update LayerRect(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); 383 383 updateTextures(); 384 384 layer->pushPropertiesTo(layerImpl.get()); … … 399 399 // not prevent the tile from being pushed. 400 400 layer->setBounds(IntSize(100, 200)); 401 layer->invalidate Rect(IntRect(0, 0, 100, 200));402 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));401 layer->invalidateContentRect(IntRect(0, 0, 100, 200)); 402 layer->setVisibleContentRect(IntRect(0, 0, 100, 200)); 403 403 layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get()); 404 404 405 405 layer->setTexturePriorities(priorityCalculator); 406 406 textureManager->prioritizeTextures(0); 407 layer->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);407 layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0); 408 408 updateTextures(); 409 409 layer->pushPropertiesTo(layerImpl.get()); … … 424 424 425 425 layer1->setBounds(IntSize(100, 200)); 426 layer1->setVisible LayerRect(IntRect(0, 0, 100, 200));427 layer1->invalidate Rect(IntRect(0, 0, 100, 200));426 layer1->setVisibleContentRect(IntRect(0, 0, 100, 200)); 427 layer1->invalidateContentRect(IntRect(0, 0, 100, 200)); 428 428 429 429 layer2->setBounds(IntSize(100, 200)); 430 layer2->setVisible LayerRect(IntRect(0, 0, 100, 200));431 layer2->invalidate Rect(IntRect(0, 0, 100, 200));430 layer2->setVisibleContentRect(IntRect(0, 0, 100, 200)); 431 layer2->invalidateContentRect(IntRect(0, 0, 100, 200)); 432 432 433 433 layer1->setTexturePriorities(priorityCalculator); … … 435 435 textureManager->prioritizeTextures(0); 436 436 437 layer1->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);437 layer1->updateContentRect(updater, IntRect(0, 0, 100, 200), 0); 438 438 439 439 // Invalidate a tile on layer1 440 440 layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get()); 441 layer2->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);441 layer2->updateContentRect(updater, IntRect(0, 0, 100, 200), 0); 442 442 443 443 updateTextures(); … … 462 462 463 463 layer1->setBounds(IntSize(100, 200)); 464 layer1->setVisible LayerRect(IntRect(0, 0, 100, 200));465 layer1->invalidate Rect(IntRect(0, 0, 100, 200));464 layer1->setVisibleContentRect(IntRect(0, 0, 100, 200)); 465 layer1->invalidateContentRect(IntRect(0, 0, 100, 200)); 466 466 467 467 layer2->setBounds(IntSize(100, 200)); 468 layer2->setVisible LayerRect(IntRect(0, 0, 100, 200));469 layer2->invalidate Rect(IntRect(0, 0, 100, 200));468 layer2->setVisibleContentRect(IntRect(0, 0, 100, 200)); 469 layer2->invalidateContentRect(IntRect(0, 0, 100, 200)); 470 470 471 471 layer1->setTexturePriorities(priorityCalculator); … … 475 475 // Invalidate a tile on layer2 476 476 layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get()); 477 layer1->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);478 layer2->update LayerRect(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); 479 479 updateTextures(); 480 480 layer1->pushPropertiesTo(layer1Impl.get()); … … 505 505 // Invalidates 9 tiles and then paints one visible tile. 506 506 layer->setBounds(contentBounds); 507 layer->setVisible LayerRect(visibleRect);508 layer->invalidate Rect(contentRect);509 510 layer->setTexturePriorities(priorityCalculator); 511 textureManager->prioritizeTextures(0); 512 layer->update LayerRect(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); 513 513 514 514 // Idle-painting should see no more priority tiles for painting. … … 523 523 layer->setTexturePriorities(priorityCalculator); 524 524 textureManager->prioritizeTextures(0); 525 layer->update LayerRect(updater, visibleRect, 0);525 layer->updateContentRect(updater, visibleRect, 0); 526 526 527 527 // We shouldn't signal we need another idle paint. … … 545 545 546 546 layer->setBounds(contentRect.size()); 547 layer->setVisible LayerRect(contentRect);548 layer->invalidate Rect(contentRect);547 layer->setVisibleContentRect(contentRect); 548 layer->invalidateContentRect(contentRect); 549 549 550 550 layer->setTexturePriorities(priorityCalculator); … … 552 552 553 553 // Empty layers don't paint or idle-paint. 554 layer->update LayerRect(updater, contentRect, 0);554 layer->updateContentRect(updater, contentRect, 0); 555 555 556 556 // Empty layers don't have tiles. … … 581 581 582 582 layer->setBounds(contentBounds); 583 layer->setVisible LayerRect(visibleRect);584 layer->invalidate Rect(contentRect);583 layer->setVisibleContentRect(visibleRect); 584 layer->invalidateContentRect(contentRect); 585 585 586 586 for (int i = 0; i < 2; i++) { … … 588 588 layer->setTexturePriorities(priorityCalculator); 589 589 textureManager->prioritizeTextures(0); 590 layer->update LayerRect(updater, visibleRect, 0);590 layer->updateContentRect(updater, visibleRect, 0); 591 591 592 592 // Non-visible layers don't need idle paint. … … 633 633 634 634 layer->setBounds(contentBounds); 635 layer->setVisible LayerRect(visibleRect);636 layer->invalidate Rect(contentRect);635 layer->setVisibleContentRect(visibleRect); 636 layer->invalidateContentRect(contentRect); 637 637 638 638 layer->setTexturePriorities(priorityCalculator); … … 651 651 textureManager->prioritizeTextures(0); 652 652 653 layer->update LayerRect(updater, visibleRect, 0);653 layer->updateContentRect(updater, visibleRect, 0); 654 654 updateTextures(); 655 655 layer->pushPropertiesTo(layerImpl.get()); … … 664 664 textureManager->prioritizeTextures(0); 665 665 666 layer->update LayerRect(updater, visibleRect, 0);666 layer->updateContentRect(updater, visibleRect, 0); 667 667 updateTextures(); 668 668 layer->pushPropertiesTo(layerImpl.get()); … … 688 688 // The tile size is 100x100, so this invalidates and then paints two tiles. 689 689 layer->setBounds(IntSize(100, 200)); 690 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));691 layer->invalidate Rect(IntRect(0, 0, 100, 200));692 layer->setTexturePriorities(priorityCalculator); 693 textureManager->prioritizeTextures(0); 694 layer->update LayerRect(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); 695 695 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 696 696 layer->pushPropertiesTo(layerImpl.get()); … … 701 701 702 702 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 703 // Invoke update LayerRect again. As the layer is valid updateLayerRect shouldn't be invoked on703 // Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on 704 704 // the LayerTextureUpdater. 705 layer->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);705 layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0); 706 706 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 707 707 EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount()); 708 708 709 layer->invalidate Rect(IntRect(0, 0, 50, 50));710 // setRectToInvalidate triggers invalidate Rect() being invoked from updateLayerRect.709 layer->invalidateContentRect(IntRect(0, 0, 50, 50)); 710 // setRectToInvalidate triggers invalidateContentRect() being invoked from updateContentRect. 711 711 layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get()); 712 712 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 713 layer->update LayerRect(updater, IntRect(0, 0, 100, 200), 0);713 layer->updateContentRect(updater, IntRect(0, 0, 100, 200), 0); 714 714 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 715 715 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); 716 716 layer->fakeLayerTextureUpdater()->clearPrepareCount(); 717 // The layer should still be invalid as update LayerRect invoked invalidate.718 layer->update LayerRect(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); 719 719 updater.update(ccContext.get(), &fakeAllocator, &fakeCopier, &fakeUploader, 1000); 720 720 EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); … … 734 734 layer->setBounds(layerBounds.size()); 735 735 layer->setContentBounds(contentBounds.size()); 736 layer->setVisible LayerRect(contentBounds);736 layer->setVisibleContentRect(contentBounds); 737 737 738 738 // On first update, the updateRect includes all tiles, even beyond the boundaries of the layer. 739 739 // However, it should still be in layer space, not content space. 740 layer->invalidate Rect(contentBounds);741 742 layer->setTexturePriorities(priorityCalculator); 743 textureManager->prioritizeTextures(0); 744 layer->update LayerRect(updater, contentBounds, 0);740 layer->invalidateContentRect(contentBounds); 741 742 layer->setTexturePriorities(priorityCalculator); 743 textureManager->prioritizeTextures(0); 744 layer->updateContentRect(updater, contentBounds, 0); 745 745 EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect()); 746 746 updateTextures(); … … 749 749 layer->setTexturePriorities(priorityCalculator); 750 750 textureManager->prioritizeTextures(0); 751 layer->invalidate Rect(contentBounds);752 layer->update LayerRect(updater, contentBounds, 0);751 layer->invalidateContentRect(contentBounds); 752 layer->updateContentRect(updater, contentBounds, 0); 753 753 EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect()); 754 754 updateTextures(); … … 756 756 // Partial re-paint should also be represented by the updateRect in layer space, not content space. 757 757 IntRect partialDamage(30, 100, 10, 10); 758 layer->invalidate Rect(partialDamage);759 layer->setTexturePriorities(priorityCalculator); 760 textureManager->prioritizeTextures(0); 761 layer->update LayerRect(updater, contentBounds, 0);758 layer->invalidateContentRect(partialDamage); 759 layer->setTexturePriorities(priorityCalculator); 760 textureManager->prioritizeTextures(0); 761 layer->updateContentRect(updater, contentBounds, 0); 762 762 EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect()); 763 763 } … … 772 772 // Create a layer with one tile. 773 773 layer->setBounds(IntSize(100, 100)); 774 layer->setVisible LayerRect(IntRect(0, 0, 100, 100));774 layer->setVisibleContentRect(IntRect(0, 0, 100, 100)); 775 775 776 776 // Invalidate the entire layer. … … 781 781 layer->setTexturePriorities(priorityCalculator); 782 782 textureManager->prioritizeTextures(0); 783 layer->update LayerRect(updater, IntRect(0, 0, 100, 100), 0);783 layer->updateContentRect(updater, IntRect(0, 0, 100, 100), 0); 784 784 updateTextures(); 785 785 layer->pushPropertiesTo(layerImpl.get()); … … 792 792 // is not scaled. 793 793 layer->setContentsScale(2); 794 layer->setVisible LayerRect(IntRect(0, 0, 200, 200));794 layer->setVisibleContentRect(IntRect(0, 0, 200, 200)); 795 795 EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 100, 100), layer->lastNeedsDisplayRect()); 796 796 … … 798 798 layer->setTexturePriorities(priorityCalculator); 799 799 textureManager->prioritizeTextures(0); 800 layer->update LayerRect(updater, IntRect(0, 0, 200, 200), 0);800 layer->updateContentRect(updater, IntRect(0, 0, 200, 200), 0); 801 801 updateTextures(); 802 802 layer->pushPropertiesTo(layerImpl.get()); … … 810 810 layer->setNeedsDisplay(); 811 811 layer->setTexturePriorities(priorityCalculator); 812 layer->update LayerRect(updater, IntRect(1, 0, 0, 1), 0);812 layer->updateContentRect(updater, IntRect(1, 0, 0, 1), 0); 813 813 textureManager->prioritizeTextures(0); 814 814 … … 840 840 841 841 rootLayer->setBounds(contentBounds); 842 rootLayer->setVisible LayerRect(contentRect);842 rootLayer->setVisibleContentRect(contentRect); 843 843 rootLayer->setPosition(FloatPoint(150, 150)); 844 844 childLayer->setBounds(contentBounds); 845 childLayer->setVisible LayerRect(contentRect);845 childLayer->setVisibleContentRect(contentRect); 846 846 childLayer->setPosition(FloatPoint(150, 150)); 847 rootLayer->invalidate Rect(contentRect);848 childLayer->invalidate Rect(contentRect);847 rootLayer->invalidateContentRect(contentRect); 848 childLayer->invalidateContentRect(contentRect); 849 849 850 850 ccLayerTreeHost->setRootLayer(rootLayer); … … 877 877 878 878 layer->setBounds(IntSize(700, 700)); 879 layer->setVisible LayerRect(IntRect(0, 0, 700, 700));880 layer->invalidate Rect(IntRect(0, 0, 700, 700));881 882 layer->setTexturePriorities(priorityCalculator); 883 textureManager->prioritizeTextures(0); 884 layer->update LayerRect(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); 885 885 886 886 layer->setBounds(IntSize(200, 200)); 887 layer->invalidate Rect(IntRect(0, 0, 200, 200));887 layer->invalidateContentRect(IntRect(0, 0, 200, 200)); 888 888 } 889 889 … … 895 895 int size = 1 << 30; 896 896 layer->setBounds(IntSize(size, size)); 897 layer->setVisible LayerRect(IntRect(0, 0, 700, 700));898 layer->invalidate Rect(IntRect(0, 0, size, size));897 layer->setVisibleContentRect(IntRect(0, 0, 700, 700)); 898 layer->invalidateContentRect(IntRect(0, 0, size, size)); 899 899 900 900 // Ensure no crash for bounds where size * size would overflow an int. 901 901 layer->setTexturePriorities(priorityCalculator); 902 902 textureManager->prioritizeTextures(0); 903 layer->update LayerRect(updater, IntRect(0, 0, 700, 700), 0);903 layer->updateContentRect(updater, IntRect(0, 0, 700, 700), 0); 904 904 } 905 905 … … 923 923 layer->setBounds(contentBounds); 924 924 layer->setPosition(FloatPoint(150, 150)); 925 layer->setVisible LayerRect(contentRect);926 layer->invalidate Rect(contentRect);925 layer->setVisibleContentRect(contentRect); 926 layer->invalidateContentRect(contentRect); 927 927 928 928 ccLayerTreeHost->setRootLayer(layer); … … 947 947 948 948 // Full update of 3 tiles and partial update of 3 tiles. 949 layer->invalidate Rect(IntRect(0, 0, 300, 150));949 layer->invalidateContentRect(IntRect(0, 0, 300, 150)); 950 950 ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); 951 951 { … … 965 965 966 966 // Partial update of 6 tiles. 967 layer->invalidate Rect(IntRect(50, 50, 200, 100));967 layer->invalidateContentRect(IntRect(50, 50, 200, 100)); 968 968 { 969 969 DebugScopedSetImplThread implThread; … … 983 983 984 984 // Checkerboard all tiles. 985 layer->invalidate Rect(IntRect(0, 0, 300, 200));985 layer->invalidateContentRect(IntRect(0, 0, 300, 200)); 986 986 { 987 987 DebugScopedSetImplThread implThread; … … 992 992 993 993 // Partial update of 6 checkerboard tiles. 994 layer->invalidate Rect(IntRect(50, 50, 200, 100));994 layer->invalidateContentRect(IntRect(50, 50, 200, 100)); 995 995 { 996 996 DebugScopedSetImplThread implThread; … … 1010 1010 1011 1011 // Partial update of 4 tiles. 1012 layer->invalidate Rect(IntRect(50, 50, 100, 100));1012 layer->invalidateContentRect(IntRect(50, 50, 100, 100)); 1013 1013 { 1014 1014 DebugScopedSetImplThread implThread; … … 1036 1036 // The tile size is 100x100, so this invalidates and then paints two tiles. 1037 1037 layer->setBounds(IntSize(100, 200)); 1038 layer->setVisible LayerRect(IntRect(0, 0, 100, 200));1039 layer->invalidate Rect(IntRect(0, 0, 100, 200));1040 1041 layer->setTexturePriorities(priorityCalculator); 1042 textureManager->prioritizeTextures(0); 1043 layer->update LayerRect(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); 1044 1044 EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1045 1045 } … … 1057 1057 1058 1058 occluded.setOcclusion(IntRect(200, 200, 300, 100)); 1059 layer->setVisible LayerRect(IntRect(IntPoint(), layer->bounds()));1060 layer->invalidate Rect(IntRect(0, 0, 600, 600));1061 1062 layer->setTexturePriorities(priorityCalculator); 1063 textureManager->prioritizeTextures(0); 1064 layer->update LayerRect(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); 1065 1065 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1066 1066 … … 1072 1072 1073 1073 occluded.setOcclusion(IntRect(250, 200, 300, 100)); 1074 layer->invalidate Rect(IntRect(0, 0, 600, 600));1075 layer->update LayerRect(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); 1076 1076 EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1077 1077 … … 1083 1083 1084 1084 occluded.setOcclusion(IntRect(250, 250, 300, 100)); 1085 layer->invalidate Rect(IntRect(0, 0, 600, 600));1086 layer->update LayerRect(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); 1087 1087 EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1088 1088 … … 1105 1105 // The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled. 1106 1106 occluded.setOcclusion(IntRect(200, 200, 300, 150)); 1107 layer->setVisible LayerRect(IntRect(0, 0, 600, 360));1108 layer->invalidate Rect(IntRect(0, 0, 600, 600));1109 1110 layer->setTexturePriorities(priorityCalculator); 1111 textureManager->prioritizeTextures(0); 1112 layer->update LayerRect(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); 1113 1113 EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1114 1114 … … 1121 1121 // Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded. 1122 1122 occluded.setOcclusion(IntRect(200, 200, 300, 150)); 1123 layer->setVisible LayerRect(IntRect(0, 0, 600, 350));1124 layer->invalidate Rect(IntRect(0, 0, 600, 600));1125 layer->setTexturePriorities(priorityCalculator); 1126 textureManager->prioritizeTextures(0); 1127 layer->update LayerRect(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); 1128 1128 EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1129 1129 … … 1136 1136 // Now the visible region is even smaller than the occlusion, it should have the same result. 1137 1137 occluded.setOcclusion(IntRect(200, 200, 300, 150)); 1138 layer->setVisible LayerRect(IntRect(0, 0, 600, 340));1139 layer->invalidate Rect(IntRect(0, 0, 600, 600));1140 layer->setTexturePriorities(priorityCalculator); 1141 textureManager->prioritizeTextures(0); 1142 layer->update LayerRect(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); 1143 1143 EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1144 1144 … … 1161 1161 1162 1162 occluded.setOcclusion(IntRect(200, 200, 300, 100)); 1163 layer->setVisible LayerRect(IntRect(0, 0, 600, 600));1164 layer->invalidate Rect(IntRect(0, 0, 600, 600));1165 layer->setTexturePriorities(priorityCalculator); 1166 textureManager->prioritizeTextures(0); 1167 layer->update LayerRect(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); 1168 1168 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1169 1169 updateTextures(); … … 1176 1176 1177 1177 // Repaint without marking it dirty. The 3 culled tiles will be pre-painted now. 1178 layer->update LayerRect(updater, IntRect(0, 0, 600, 600), &occluded);1178 layer->updateContentRect(updater, IntRect(0, 0, 600, 600), &occluded); 1179 1179 EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1180 1180 … … 1201 1201 1202 1202 occluded.setOcclusion(IntRect(100, 100, 150, 50)); 1203 layer->setVisible LayerRect(IntRect(IntPoint(), layer->bounds()));1204 layer->invalidate Rect(IntRect(0, 0, 600, 600));1205 layer->setTexturePriorities(priorityCalculator); 1206 textureManager->prioritizeTextures(0); 1207 layer->update LayerRect(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); 1208 1208 EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1209 1209 … … 1229 1229 1230 1230 occluded.setOcclusion(IntRect(200, 200, 300, 100)); 1231 layer->setVisible LayerRect(IntRect(IntPoint(), layer->bounds()));1232 layer->invalidate Rect(IntRect(0, 0, 600, 600));1233 layer->setTexturePriorities(priorityCalculator); 1234 textureManager->prioritizeTextures(0); 1235 layer->update LayerRect(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); 1236 1236 // The content is half the size of the layer (so the number of tiles is fewer). 1237 1237 // In this case, the content is 300x300, and since the tile size is 100, the … … 1249 1249 // blown up tiles. 1250 1250 occluded.setOcclusion(IntRect(200, 200, 300, 200)); 1251 layer->setVisible LayerRect(IntRect(IntPoint(), layer->bounds()));1252 layer->invalidate Rect(IntRect(0, 0, 600, 600));1253 layer->setTexturePriorities(priorityCalculator); 1254 textureManager->prioritizeTextures(0); 1255 layer->update LayerRect(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); 1256 1256 EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1257 1257 … … 1269 1269 1270 1270 occluded.setOcclusion(IntRect(100, 100, 150, 100)); 1271 layer->setVisible LayerRect(IntRect(IntPoint(), layer->bounds()));1272 layer->invalidate Rect(IntRect(0, 0, 600, 600));1273 layer->setTexturePriorities(priorityCalculator); 1274 textureManager->prioritizeTextures(0); 1275 layer->update LayerRect(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); 1276 1276 EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); 1277 1277 … … 1297 1297 layer->setBounds(contentBounds.size()); 1298 1298 layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0)); 1299 layer->setVisible LayerRect(visibleBounds);1299 layer->setVisibleContentRect(visibleBounds); 1300 1300 layer->setDrawOpacity(1); 1301 1301 … … 1305 1305 // If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty. 1306 1306 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1307 layer->invalidate Rect(contentBounds);1308 layer->update LayerRect(updater, contentBounds, &occluded);1307 layer->invalidateContentRect(contentBounds); 1308 layer->updateContentRect(updater, contentBounds, &occluded); 1309 1309 opaqueContents = layer->visibleContentOpaqueRegion(); 1310 1310 EXPECT_TRUE(opaqueContents.isEmpty()); … … 1318 1318 opaquePaintRect = IntRect(10, 10, 90, 190); 1319 1319 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect); 1320 layer->invalidate Rect(contentBounds);1321 layer->update LayerRect(updater, contentBounds, &occluded);1320 layer->invalidateContentRect(contentBounds); 1321 layer->updateContentRect(updater, contentBounds, &occluded); 1322 1322 updateTextures(); 1323 1323 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1332 1332 // If we paint again without invalidating, the same stuff should be opaque. 1333 1333 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1334 layer->update LayerRect(updater, contentBounds, &occluded);1334 layer->updateContentRect(updater, contentBounds, &occluded); 1335 1335 updateTextures(); 1336 1336 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1346 1346 // not be affected. 1347 1347 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1348 layer->invalidate Rect(IntRect(0, 0, 1, 1));1349 layer->update LayerRect(updater, contentBounds, &occluded);1348 layer->invalidateContentRect(IntRect(0, 0, 1, 1)); 1349 layer->updateContentRect(updater, contentBounds, &occluded); 1350 1350 updateTextures(); 1351 1351 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1361 1361 // not be affected. 1362 1362 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1363 layer->invalidate Rect(IntRect(10, 10, 1, 1));1364 layer->update LayerRect(updater, contentBounds, &occluded);1363 layer->invalidateContentRect(IntRect(10, 10, 1, 1)); 1364 layer->updateContentRect(updater, contentBounds, &occluded); 1365 1365 updateTextures(); 1366 1366 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1390 1390 layer->setBounds(contentBounds.size()); 1391 1391 layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0)); 1392 layer->setVisible LayerRect(visibleBounds);1392 layer->setVisibleContentRect(visibleBounds); 1393 1393 layer->setDrawOpacity(1); 1394 1394 … … 1398 1398 // Invalidates and paints the whole layer. 1399 1399 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1400 layer->invalidate Rect(contentBounds);1401 layer->update LayerRect(updater, contentBounds, &occluded);1400 layer->invalidateContentRect(contentBounds); 1401 layer->updateContentRect(updater, contentBounds, &occluded); 1402 1402 updateTextures(); 1403 1403 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1412 1412 // even though it is not dirty and will not be uploaded. 1413 1413 layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); 1414 layer->invalidate Rect(IntRect(0, 0, 1, 1));1415 layer->invalidate Rect(IntRect(50, 200, 10, 10));1416 layer->update LayerRect(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); 1417 1417 updateTextures(); 1418 1418 opaqueContents = layer->visibleContentOpaqueRegion(); … … 1449 1449 root->setBounds(rootRect.size()); 1450 1450 root->setAnchorPoint(FloatPoint()); 1451 root->setVisible LayerRect(rootRect);1451 root->setVisibleContentRect(rootRect); 1452 1452 root->addChild(surface); 1453 1453 … … 1461 1461 child->setAnchorPoint(FloatPoint()); 1462 1462 child->setPosition(childRect.location()); 1463 child->setVisible LayerRect(childRect);1463 child->setVisibleContentRect(childRect); 1464 1464 1465 1465 child2->setBounds(child2Rect.size()); 1466 1466 child2->setAnchorPoint(FloatPoint()); 1467 1467 child2->setPosition(child2Rect.location()); 1468 child2->setVisible LayerRect(child2Rect);1468 child2->setVisibleContentRect(child2Rect); 1469 1469 1470 1470 ccLayerTreeHost->setRootLayer(root); … … 1472 1472 1473 1473 // With a huge memory limit, all layers should update and push their textures. 1474 root->invalidate Rect(rootRect);1475 child->invalidate Rect(childRect);1476 child2->invalidate Rect(child2Rect);1474 root->invalidateContentRect(rootRect); 1475 child->invalidateContentRect(childRect); 1476 child2->invalidateContentRect(child2Rect); 1477 1477 ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); 1478 1478 { … … 1507 1507 // the child layers draw into, the child layers will not be allocated. If the surface isn't 1508 1508 // accounted for, then one of the children would fit within the memory limit. 1509 root->invalidate Rect(rootRect);1510 child->invalidate Rect(childRect);1511 child2->invalidate Rect(child2Rect);1509 root->invalidateContentRect(rootRect); 1510 child->invalidateContentRect(childRect); 1511 child2->invalidateContentRect(child2Rect); 1512 1512 ccLayerTreeHost->updateLayers(updater, (3 * 2 + 3 * 1) * (100 * 100) * 4); 1513 1513 { … … 1543 1543 // for one of the children layers, but they draw into a surface that can't be 1544 1544 // allocated. 1545 root->invalidate Rect(rootRect);1546 child->invalidate Rect(childRect);1547 child2->invalidate Rect(child2Rect);1545 root->invalidateContentRect(rootRect); 1546 child->invalidateContentRect(childRect); 1547 child2->invalidateContentRect(child2Rect); 1548 1548 ccLayerTreeHost->updateLayers(updater, (3 * 1) * (100 * 100) * 4); 1549 1549 { … … 1634 1634 IntRect contentRect(0, 0, 45, 47); 1635 1635 EXPECT_EQ(contentRect.size(), layer->contentBounds()); 1636 layer->setVisible LayerRect(contentRect);1636 layer->setVisibleContentRect(contentRect); 1637 1637 1638 1638 layer->setTexturePriorities(calculator); … … 1640 1640 1641 1641 // Update the whole tile. 1642 layer->update LayerRect(updater, contentRect, 0);1642 layer->updateContentRect(updater, contentRect, 0); 1643 1643 layer->trackingLayerPainter()->resetPaintedRect(); 1644 1644 … … 1648 1648 1649 1649 // Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds. 1650 layer->invalidate Rect(contentRect);1651 layer->update LayerRect(updater, contentRect, 0);1650 layer->invalidateContentRect(contentRect); 1651 layer->updateContentRect(updater, contentRect, 0); 1652 1652 1653 1653 EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); … … 1667 1667 1668 1668 IntRect contentRect(IntPoint(), layer->contentBounds()); 1669 layer->setVisible LayerRect(contentRect);1669 layer->setVisibleContentRect(contentRect); 1670 1670 1671 1671 layer->setTexturePriorities(calculator); … … 1673 1673 1674 1674 // Update the whole tile. 1675 layer->update LayerRect(updater, contentRect, 0);1675 layer->updateContentRect(updater, contentRect, 0); 1676 1676 layer->trackingLayerPainter()->resetPaintedRect(); 1677 1677 … … 1682 1682 // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. 1683 1683 layer->setNeedsDisplayRect(layerRect); 1684 layer->update LayerRect(updater, contentRect, 0);1684 layer->updateContentRect(updater, contentRect, 0); 1685 1685 1686 1686 EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
Note: See TracChangeset
for help on using the changeset viewer.