Changeset 85959 in webkit
- Timestamp:
- May 6, 2011 10:41:46 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85957 r85959 1 2011-05-04 Adrienne Walker <enne@google.com> 2 3 Reviewed by James Robinson. 4 5 [chromium] Fix incorrect scissor rect for layers that render into a rendersurface 6 https://bugs.webkit.org/show_bug.cgi?id=59020 7 8 * compositing/flat-with-transformed-child-expected.txt: Added. 9 * compositing/flat-with-transformed-child.html: Added. 10 * platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.checksum: Added. 11 * platform/chromium-gpu-linux/compositing/flat-with-transformed-child-expected.png: Added. 12 * platform/chromium/test_expectations.txt: 13 1 14 2011-05-05 Ojan Vafai <ojan@chromium.org> 2 15 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r85950 r85959 4088 4088 BUGWK60356 : svg/filters/subRegion-one-effect.svg = IMAGE 4089 4089 BUGWK60356 : svg/filters/subRegion-two-effects.svg = IMAGE 4090 4091 // Needs baselines everywhere 4092 BUGENNE GPU : compositing/flat-with-transformed-child.html = PASS FAIL MISSING -
trunk/Source/WebCore/ChangeLog
r85955 r85959 1 2011-05-04 Adrienne Walker <enne@google.com> 2 3 Reviewed by James Robinson. 4 5 [chromium] Fix incorrect scissor rect for layers that render into a rendersurface 6 https://bugs.webkit.org/show_bug.cgi?id=59020 7 8 Allow for empty scissor rects, which implies scissoring to the render 9 surface. The previous code and previous patch on this bug both didn't 10 take into account that the scissor rect should be the render surface 11 and not the projection of the layer itself, because child layers 12 aren't necessarily contained within the bounds of their superlayer. 13 14 Test: compositing/flat-with-transformed-child.html 15 16 * platform/graphics/chromium/LayerRendererChromium.cpp: 17 (WebCore::LayerRendererChromium::paintLayerContents): 18 (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): 19 (WebCore::LayerRendererChromium::drawLayer): 20 (WebCore::LayerRendererChromium::setScissorToRect): 21 1 22 2011-05-06 Simon Fraser <simon.fraser@apple.com> 2 23 -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r85814 r85959 366 366 continue; 367 367 368 const IntRect targetSurfaceRect = layer->ccLayerImpl()->scissorRect(); 368 IntRect targetSurfaceRect = ccLayerImpl->targetRenderSurface() ? ccLayerImpl->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect(); 369 IntRect scissorRect = layer->ccLayerImpl()->scissorRect(); 370 if (!scissorRect.isEmpty()) 371 targetSurfaceRect.intersect(scissorRect); 369 372 370 373 if (layer->drawsContent()) … … 640 643 layerOriginTransform.translate3d(-0.5 * bounds.width(), -0.5 * bounds.height(), 0); 641 644 renderSurface->m_originTransform = layerOriginTransform; 642 if (layerOriginTransform.isInvertible() && drawLayer->superlayer()) { 643 TransformationMatrix parentToLayer = layerOriginTransform.inverse(); 644 645 drawLayer->setScissorRect(parentToLayer.mapRect(drawLayer->superlayer()->scissorRect())); 646 } else 647 drawLayer->setScissorRect(IntRect()); 645 drawLayer->setScissorRect(IntRect()); 648 646 649 647 // The render surface scissor rect is the scissor rect that needs to … … 685 683 686 684 if (drawLayer->masksToBounds()) { 687 IntRect scissor = drawLayer->scissorRect(); 688 scissor.intersect(transformedLayerRect); 685 IntRect scissor = transformedLayerRect; 686 if (!drawLayer->scissorRect().isEmpty()) 687 scissor.intersect(drawLayer->scissorRect()); 689 688 drawLayer->setScissorRect(scissor); 690 689 } … … 766 765 // clipped. 767 766 if (!drawLayer->replicaLayer()) { 768 renderSurface->m_contentRect.intersect(drawLayer->scissorRect()); 767 if (!drawLayer->scissorRect().isEmpty()) 768 renderSurface->m_contentRect.intersect(drawLayer->scissorRect()); 769 769 FloatPoint clippedSurfaceCenter = renderSurface->contentRectCenter(); 770 770 centerOffsetDueToClipping = clippedSurfaceCenter - surfaceCenter; … … 908 908 setScissorToRect(layer->scissorRect()); 909 909 910 IntRect targetSurfaceRect = m_currentRenderSurface ? m_currentRenderSurface->contentRect() : m_defaultRenderSurface->contentRect(); 911 IntRect scissorRect = layer->scissorRect(); 912 if (!scissorRect.isEmpty()) 913 targetSurfaceRect.intersect(scissorRect); 914 910 915 // Check if the layer falls within the visible bounds of the page. 911 916 IntRect layerRect = layer->getDrawRect(); 912 bool isLayerVisible = layer->scissorRect().intersects(layerRect);917 bool isLayerVisible = targetSurfaceRect.intersects(layerRect); 913 918 if (!isLayerVisible) { 914 919 layer->unreserveContentsTexture(); … … 934 939 } 935 940 936 layer->draw( layer->scissorRect());941 layer->draw(targetSurfaceRect); 937 942 938 943 // Draw the debug border if there is one. … … 942 947 // Sets the scissor region to the given rectangle. The coordinate system for the 943 948 // scissorRect has its origin at the top left corner of the current visible rect. 944 void LayerRendererChromium::setScissorToRect(const IntRect& scissorRect)949 void LayerRendererChromium::setScissorToRect(const IntRect& requestedScissor) 945 950 { 946 951 IntRect contentRect = (m_currentRenderSurface ? m_currentRenderSurface->m_contentRect : m_defaultRenderSurface->m_contentRect); 952 953 const IntRect scissorRect = requestedScissor.isEmpty() ? contentRect : requestedScissor; 947 954 948 955 // The scissor coordinates must be supplied in viewport space so we need to offset
Note: See TracChangeset
for help on using the changeset viewer.