Changeset 85814 in webkit
- Timestamp:
- May 4, 2011 5:42:19 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85811 r85814 1 2011-05-04 Vangelis Kokkevis <vangelis@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Adding a new layout test for perpendicular layers. 6 https://bugs.webkit.org/show_bug.cgi?id=59255 7 8 * platform/chromium-gpu-mac/platform/chromium/compositing/perpendicular-layer-sorting-expected.png: Added. 9 * platform/chromium-gpu-mac/platform/chromium/compositing/perpendicular-layer-sorting-expected.txt: Added. 10 * platform/chromium/compositing/perpendicular-layer-sorting.html: Added. 11 * platform/chromium/test_expectations.txt: 12 1 13 2011-05-03 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r85805 r85814 2834 2834 BUGWK58182 GPU : compositing/images/content-image-change.html = PASS FAIL 2835 2835 BUGWK58398 GPU : platform/chromium/compositing/child-layer-3d-sorting.html = PASS FAIL MISSING 2836 BUGVANGELIS GPU WIN LINUX : platform/chromium/compositing/perpendicular-layer-sorting.html = PASS FAIL MISSING 2836 2837 2837 2838 // The picture does not match the video in the test. -
trunk/Source/WebCore/ChangeLog
r85811 r85814 1 2011-05-04 Vangelis Kokkevis <vangelis@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 [chromium] Improve sorting of layers in hierarchies that preserve-3d 6 by testing for overlapping regions between layer pairs and doing a 7 topological sort to determine the right order. 8 https://bugs.webkit.org/show_bug.cgi?id=59255 9 10 Test: platform/chromium/compositing/perpendicular-layer-sorting.html 11 12 * WebCore.gypi: 13 * platform/graphics/chromium/LayerRendererChromium.cpp: 14 (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces): 15 * platform/graphics/chromium/LayerRendererChromium.h: 16 * platform/graphics/chromium/cc/CCLayerImpl.h: 17 (WebCore::CCLayerImpl::clearRenderSurface): 18 * platform/graphics/chromium/cc/CCLayerSorter.cpp: Added. 19 (WebCore::perpProduct): 20 (WebCore::innerProduct): 21 (WebCore::pointInColinearEdge): 22 (WebCore::edgeEdgeTest): 23 (WebCore::CCLayerSorter::LayerIntersector::LayerIntersector): 24 (WebCore::CCLayerSorter::LayerIntersector::go): 25 (WebCore::CCLayerSorter::LayerIntersector::edgeTriangleTest): 26 (WebCore::CCLayerSorter::LayerIntersector::triangleTriangleTest): 27 (WebCore::CCLayerSorter::LayerIntersector::checkZDiff): 28 (WebCore::CCLayerSorter::LayerIntersector::layerZFromProjectedPoint): 29 (WebCore::CCLayerSorter::CCLayerSorter): 30 (WebCore::CCLayerSorter::checkOverlap): 31 (WebCore::CCLayerSorter::createGraphNodes): 32 (WebCore::CCLayerSorter::createGraphEdges): 33 (WebCore::CCLayerSorter::removeEdgeFromList): 34 (WebCore::CCLayerSorter::sort): 35 * platform/graphics/chromium/cc/CCLayerSorter.h: Added. 36 (WebCore::CCLayerSorter::GraphNode::GraphNode): 37 (WebCore::CCLayerSorter::GraphEdge::GraphEdge): 38 1 39 2011-05-03 Jer Noble <jer.noble@apple.com> 2 40 -
trunk/Source/WebCore/WebCore.gypi
r85785 r85814 4065 4065 'platform/graphics/chromium/cc/CCLayerImpl.cpp', 4066 4066 'platform/graphics/chromium/cc/CCLayerImpl.h', 4067 'platform/graphics/chromium/cc/CCLayerSorter.cpp', 4068 'platform/graphics/chromium/cc/CCLayerSorter.h', 4067 4069 'platform/graphics/chromium/cc/CCMainThread.cpp', 4068 4070 'platform/graphics/chromium/cc/CCMainThread.h', -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r85261 r85814 94 94 } 95 95 96 bool LayerRendererChromium::compareLayerZ(const RefPtr<CCLayerImpl>& a, const RefPtr<CCLayerImpl>& b)97 {98 return a->drawDepth() < b->drawDepth();99 }100 101 96 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TilePaintInterface> contentPaint) 102 97 { … … 615 610 // 3. The layer uses a mask 616 611 // 4. The layer has a replica (used for reflections) 612 // 5. The layer doesn't preserve-3d but is the child of a layer which does. 617 613 // If a layer preserves-3d then we don't create a RenderSurface for it to avoid flattening 618 614 // out its children. The opacity value of the children layers is multiplied by the opacity … … 622 618 bool useSurfaceForMasking = drawLayer->maskLayer(); 623 619 bool useSurfaceForReflection = drawLayer->replicaLayer(); 624 if (useSurfaceForMasking || useSurfaceForReflection || ((useSurfaceForClipping || useSurfaceForOpacity) && drawLayer->descendantsDrawsContent())) { 620 bool useSurfaceForFlatDescendants = (drawLayer->superlayer() && drawLayer->superlayer()->preserves3D() && !drawLayer->preserves3D() && drawLayer->descendantsDrawsContent()); 621 if (useSurfaceForMasking || useSurfaceForReflection || useSurfaceForFlatDescendants || ((useSurfaceForClipping || useSurfaceForOpacity) && drawLayer->descendantsDrawsContent())) { 625 622 RenderSurfaceChromium* renderSurface = drawLayer->renderSurface(); 626 623 if (!renderSurface) … … 728 725 // M[s] = M * Tr[-center] 729 726 sublayerMatrix.translate3d(-bounds.width() * 0.5, -bounds.height() * 0.5, 0); 730 731 // Compute the depth value of the center of the layer which will be used when732 // sorting the layers for the preserves-3d property.733 const TransformationMatrix& layerDrawMatrix = drawLayer->renderSurface() ? drawLayer->renderSurface()->m_drawTransform : drawLayer->drawTransform();734 if (drawLayer->superlayer()) {735 if (!drawLayer->superlayer()->preserves3D())736 drawLayer->setDrawDepth(drawLayer->superlayer()->drawDepth());737 else738 drawLayer->setDrawDepth(layerDrawMatrix.m43());739 } else740 drawLayer->setDrawDepth(0);741 727 742 728 LayerList& descendants = (drawLayer->renderSurface() ? drawLayer->renderSurface()->m_layerList : layerList); … … 811 797 } 812 798 813 // If preserves-3d then sort all the descendants by the Z coordinate of their814 // center. If the preserves-3d property is also set on the superlayer then799 // If preserves-3d then sort all the descendants in 3D so that they can be 800 // drawn from back to front. If the preserves-3d property is also set on the superlayer then 815 801 // skip the sorting as the superlayer will sort all the descendants anyway. 816 802 if (drawLayer->preserves3D() && (!drawLayer->superlayer() || !drawLayer->superlayer()->preserves3D())) 817 std::stable_sort(&descendants.at(thisLayerIndex), descendants.end(), compareLayerZ);803 m_layerSorter.sort(&descendants.at(thisLayerIndex), descendants.end()); 818 804 } 819 805 -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r85136 r85814 44 44 #include "cc/CCCanvasLayerImpl.h" 45 45 #include "cc/CCHeadsUpDisplay.h" 46 #include "cc/CCLayerSorter.h" 46 47 #include "cc/CCPluginLayerImpl.h" 47 48 #include "cc/CCVideoLayerImpl.h" … … 235 236 236 237 RenderSurfaceChromium* m_defaultRenderSurface; 238 239 CCLayerSorter m_layerSorter; 237 240 }; 238 241 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r84582 r85814 117 117 RenderSurfaceChromium* renderSurface() const { return m_renderSurface.get(); } 118 118 void clearRenderSurface() { m_renderSurface.clear(); } 119 float drawDepth() const { return m_drawDepth; }120 void setDrawDepth(float depth) { m_drawDepth = depth; }121 119 float drawOpacity() const { return m_drawOpacity; } 122 120 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; }
Note: See TracChangeset
for help on using the changeset viewer.