Changeset 88496 in webkit
- Timestamp:
- Jun 9, 2011 3:53:53 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88490 r88496 1 2011-06-09 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Scissor rect not set for clipping layers set offscreen 6 https://bugs.webkit.org/show_bug.cgi?id=62339 7 8 Tests that a layer that should clip its children actually does clip even when scrolled offscreen. 9 10 * platform/chromium/compositing/scissor-out-of-viewport-expected.png: Added. 11 * platform/chromium/compositing/scissor-out-of-viewport-expected.txt: Added. 12 * platform/chromium/compositing/scissor-out-of-viewport.html: Added. 13 1 14 2011-06-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r88490 r88496 1 2011-06-09 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Scissor rect not set for clipping layers set offscreen 6 https://bugs.webkit.org/show_bug.cgi?id=62339 7 8 We set a scissorRect on each layer, but only layers with masksToBounds and their descendants should actually set 9 a scissor. Layers that didn't need to scissor had empty scissorRects. Unfortunately layers with masksToBounds 10 and their descendants that are scrolled offscreen also end up with an empty clipped scissor rect. 11 12 This patch sets an explicit bit on each layer that should scissor and then checks that bit instead of checking 13 for an empty scissor rect at draw time. RenderSurfaceChromiums have different requirements for 14 setScissorToRect, so the old behavior is still available with a flag. This can probably be cleaned up more. 15 16 Test: platform/chromium/compositing/scissor-out-of-viewport.html 17 18 * platform/graphics/chromium/LayerRendererChromium.cpp: 19 (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): 20 (WebCore::LayerRendererChromium::drawLayer): 21 (WebCore::LayerRendererChromium::setScissorToRect): 22 * platform/graphics/chromium/LayerRendererChromium.h: 23 * platform/graphics/chromium/RenderSurfaceChromium.cpp: 24 (WebCore::RenderSurfaceChromium::draw): 25 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 26 (WebCore::CCLayerImpl::CCLayerImpl): 27 * platform/graphics/chromium/cc/CCLayerImpl.h: 28 (WebCore::CCLayerImpl::setUsesLayerScissor): 29 (WebCore::CCLayerImpl::usesLayerScissor): 30 1 31 2011-06-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 32 -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r87762 r88496 659 659 IntRect transformedLayerRect; 660 660 661 // FIXME: This seems like the wrong place to set this 662 layer->setUsesLayerScissor(false); 663 661 664 // The layer and its descendants render on a new RenderSurface if any of 662 665 // these conditions hold: … … 695 698 layerOriginTransform.translate3d(-0.5 * bounds.width(), -0.5 * bounds.height(), 0); 696 699 renderSurface->m_originTransform = layerOriginTransform; 697 layer->setScissorRect(IntRect());698 700 699 701 // The render surface scissor rect is the scissor rect that needs to … … 727 729 // Layers inherit the scissor rect from their parent. 728 730 layer->setScissorRect(layer->parent()->scissorRect()); 731 if (layer->parent()->usesLayerScissor()) 732 layer->setUsesLayerScissor(true); 729 733 730 734 layer->setTargetRenderSurface(layer->parent()->targetRenderSurface()); … … 739 743 scissor.intersect(layer->scissorRect()); 740 744 layer->setScissorRect(scissor); 745 layer->setUsesLayerScissor(true); 741 746 } 742 747 } … … 974 979 } 975 980 976 setScissorToRect(layer->scissorRect()); 977 981 if (layer->usesLayerScissor()) 982 setScissorToRect(layer->scissorRect()); 983 else 984 GLC(m_context.get(), m_context->disable(GraphicsContext3D::SCISSOR_TEST)); 978 985 IntRect targetSurfaceRect = m_currentRenderSurface ? m_currentRenderSurface->contentRect() : m_defaultRenderSurface->contentRect(); 979 IntRect scissorRect = layer->scissorRect();980 if (!scissorRect.isEmpty())981 targetSurfaceRect.intersect(scissorRect);982 986 983 987 // Check if the layer falls within the visible bounds of the page. … … 1015 1019 // Sets the scissor region to the given rectangle. The coordinate system for the 1016 1020 // scissorRect has its origin at the top left corner of the current visible rect. 1017 void LayerRendererChromium::setScissorToRect(const IntRect& requestedScissor)1021 void LayerRendererChromium::setScissorToRect(const IntRect& scissorRect) 1018 1022 { 1019 1023 IntRect contentRect = (m_currentRenderSurface ? m_currentRenderSurface->m_contentRect : m_defaultRenderSurface->m_contentRect); 1020 1024 1021 const IntRect scissorRect = requestedScissor.isEmpty() ? contentRect : requestedScissor;1025 GLC(m_context.get(), m_context->enable(GraphicsContext3D::SCISSOR_TEST)); 1022 1026 1023 1027 // The scissor coordinates must be supplied in viewport space so we need to offset -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
r86975 r88496 153 153 replicaMaskLayer = m_owningLayer->replicaLayer()->maskLayer(); 154 154 155 layerRenderer()->setScissorToRect(m_scissorRect); 155 if (m_owningLayer->parent() && m_owningLayer->parent()->usesLayerScissor()) 156 layerRenderer()->setScissorToRect(m_scissorRect); 157 else 158 GLC(layerRenderer()->context(), layerRenderer()->context()->disable(GraphicsContext3D::SCISSOR_TEST)); 159 156 160 157 161 // Reflection draws before the layer. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r87752 r88496 71 71 , m_opacity(1.0) 72 72 , m_preserves3D(false) 73 , m_usesLayerScissor(false) 73 74 , m_targetRenderSurface(0) 74 75 , m_drawDepth(0) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r86652 r88496 101 101 bool preserves3D() const { return m_preserves3D; } 102 102 103 void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; } 104 bool usesLayerScissor() const { return m_usesLayerScissor; } 105 103 106 void setSublayerTransform(const TransformationMatrix& sublayerTransform) { m_sublayerTransform = sublayerTransform; } 104 107 const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; } … … 184 187 TransformationMatrix m_sublayerTransform; 185 188 TransformationMatrix m_transform; 189 bool m_usesLayerScissor; 186 190 187 191 // Properties owned exclusively by this CCLayerImpl.
Note: See TracChangeset
for help on using the changeset viewer.