Changeset 103990 in webkit
- Timestamp:
- Jan 3, 2012 4:53:45 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 2 deleted
- 26 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r103987 r103990 1 2012-01-03 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Push drawsContent and contentsVisible into accelerated compositor 4 https://bugs.webkit.org/show_bug.cgi?id=71209 5 6 Reviewed by James Robinson. 7 8 * compositing/visibility/visibility-image-layers-expected.png: 9 * compositing/visibility/visibility-image-layers-expected.txt: Renamed from LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-expected.txt. 10 * compositing/visibility/visibility-simple-canvas2d-layer-expected.png: Added. 11 * compositing/visibility/visibility-simple-canvas2d-layer-expected.txt: Added. 12 * compositing/visibility/visibility-simple-canvas2d-layer.html: Added. 13 * compositing/visibility/visibility-simple-video-layer-expected.png: Added. 14 * compositing/visibility/visibility-simple-video-layer-expected.txt: Added. 15 * compositing/visibility/visibility-simple-video-layer.html: Added. 16 * compositing/visibility/visibility-simple-webgl-layer-expected.png: Added. 17 * compositing/visibility/visibility-simple-webgl-layer-expected.txt: Added. 18 * compositing/visibility/visibility-simple-webgl-layer.html: Added. 19 * platform/chromium-mac-snowleopard/compositing/visibility/visibility-image-layers-expected.png: Removed. 20 * platform/chromium-win/compositing/visibility/visibility-image-layers-expected.png: Removed. 21 * platform/chromium/test_expectations.txt: 22 1 23 2012-01-03 Tony Chang <tony@chromium.org> 2 24 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r103987 r103990 1148 1148 // and then baselined if necessary. 1149 1149 // ---------------------------------------------------------------------------- 1150 1151 // These four expectations can be removed after verifying the correctness / rebaselining on all platforms. 1152 BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-webgl-layer.html = IMAGE 1153 BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-canvas2d-layer.html = IMAGE 1154 BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-video-layer.html = IMAGE 1155 BUGWK71209 LINUX WIN : compositing/visibility/visibility-image-layers.html = IMAGE 1150 1156 1151 1157 // This test isn't hanging, it just takes 12-13 seconds to run. … … 3662 3668 BUGWK70988 MAC DEBUG SLOW : fast/frames/calculate-fixed.html = PASS 3663 3669 3664 BUGWK71209 LINUX MAC : compositing/visibility/visibility-image-layers.html = IMAGE3665 3666 3670 BUGWK71211 GPU LINUX DEBUG : fast/canvas/shadow-offset-3.html = PASS CRASH 3667 3671 BUGWK71214 LEOPARD CPU-CG : css2.1/20110323/block-non-replaced-width-008.htm = FAIL -
trunk/Source/WebCore/ChangeLog
r103988 r103990 1 2012-01-03 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Push drawsContent and contentsVisible into accelerated compositor 4 https://bugs.webkit.org/show_bug.cgi?id=71209 5 6 Reviewed by James Robinson. 7 8 Tests: compositing/visibility/visibility-simple-canvas2d-layer.html 9 compositing/visibility/visibility-simple-video-layer.html 10 compositing/visibility/visibility-simple-webgl-layer.html 11 12 Rebaselined compositing/visibility/visibility-image-layers.html 13 14 The CSS visibility property was not being properly obeyed by many 15 specialized layer types in the accelerated compositor. The root of 16 the problem was that drawsContent and contentsVisible flags were 17 not properly propagated into the compositor. This patch removes 18 the drawsContent() callback, and instead makes sure that 19 drawsContent and contentsVisible are "pushed" through the 20 accelerated compositor. 21 22 * platform/graphics/chromium/Canvas2DLayerChromium.cpp: 23 (WebCore::Canvas2DLayerChromium::drawsContent): 24 * platform/graphics/chromium/ContentLayerChromium.cpp: 25 * platform/graphics/chromium/ContentLayerChromium.h: 26 * platform/graphics/chromium/GraphicsLayerChromium.cpp: 27 (WebCore::GraphicsLayerChromium::setDrawsContent): 28 (WebCore::GraphicsLayerChromium::setContentsVisible): 29 (WebCore::GraphicsLayerChromium::setContentsToImage): 30 (WebCore::GraphicsLayerChromium::setContentsToCanvas): 31 (WebCore::GraphicsLayerChromium::setContentsToMedia): 32 (WebCore::GraphicsLayerChromium::updateLayerIsDrawable): 33 (WebCore::GraphicsLayerChromium::setupContentsLayer): 34 * platform/graphics/chromium/GraphicsLayerChromium.h: 35 * platform/graphics/chromium/LayerChromium.cpp: 36 (WebCore::LayerChromium::LayerChromium): 37 (WebCore::LayerChromium::setIsDrawable): 38 * platform/graphics/chromium/LayerChromium.h: 39 (WebCore::LayerChromium::drawsContent): 40 * platform/graphics/chromium/PluginLayerChromium.h: 41 * platform/graphics/chromium/TiledLayerChromium.cpp: 42 (WebCore::TiledLayerChromium::drawsContent): 43 * platform/graphics/chromium/VideoLayerChromium.h: 44 * platform/graphics/chromium/WebGLLayerChromium.cpp: 45 (WebCore::WebGLLayerChromium::drawsContent): 46 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 47 (WebCore::CCLayerImpl::dumpLayerProperties): 48 1 49 2012-01-03 Shawn Singh <shawnsingh@chromium.org> 2 50 -
trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
r103706 r103990 84 84 bool Canvas2DLayerChromium::drawsContent() const 85 85 { 86 return m_backTextureId && !m_size.isEmpty()86 return LayerChromium::drawsContent() && m_backTextureId && !m_size.isEmpty() 87 87 && m_context && (m_context->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR); 88 88 } -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r103290 r103990 123 123 } 124 124 125 bool ContentLayerChromium::drawsContent() const126 {127 return m_delegate && m_delegate->drawsContent() && TiledLayerChromium::drawsContent();128 }129 130 125 void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host) 131 126 { -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
r103129 r103990 58 58 private: 59 59 virtual void cleanupResources(); 60 virtual bool drawsContent() const;61 60 virtual void createTextureUpdater(const CCLayerTreeHost*); 62 61 virtual LayerTextureUpdater* textureUpdater() const { return m_textureUpdater.get(); } -
trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
r103293 r103990 219 219 void GraphicsLayerChromium::setDrawsContent(bool drawsContent) 220 220 { 221 // Note carefully this early-exit is only correct because we also properly initialize 222 // LayerChromium::isDrawable() whenever m_contentsLayer is set to a new layer in setupContentsLayer(). 221 223 if (drawsContent == m_drawsContent) 222 224 return; 223 225 224 226 GraphicsLayer::setDrawsContent(drawsContent); 225 updateLayerDrawsContent(); 227 updateLayerIsDrawable(); 228 } 229 230 void GraphicsLayerChromium::setContentsVisible(bool contentsVisible) 231 { 232 // Note carefully this early-exit is only correct because we also properly initialize 233 // LayerChromium::isDrawable() whenever m_contentsLayer is set to a new layer in setupContentsLayer(). 234 if (contentsVisible == m_contentsVisible) 235 return; 236 237 GraphicsLayer::setContentsVisible(contentsVisible); 238 updateLayerIsDrawable(); 226 239 } 227 240 … … 317 330 RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create(this); 318 331 setupContentsLayer(imageLayer.get()); 319 m_contentsLayer = imageLayer;320 332 m_contentsLayerPurpose = ContentsLayerForImage; 321 333 childrenChanged = true; … … 345 357 if (m_contentsLayer.get() != platformLayer) { 346 358 setupContentsLayer(platformLayer); 347 m_contentsLayer = platformLayer;348 359 m_contentsLayerPurpose = ContentsLayerForCanvas; 349 360 childrenChanged = true; … … 370 381 if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForVideo) { 371 382 setupContentsLayer(layer); 372 m_contentsLayer = layer;373 383 m_contentsLayerPurpose = ContentsLayerForVideo; 374 384 childrenChanged = true; … … 569 579 } 570 580 571 void GraphicsLayerChromium::updateLayerDrawsContent() 572 { 581 void GraphicsLayerChromium::updateLayerIsDrawable() 582 { 583 // For the rest of the accelerated compositor code, there is no reason to make a 584 // distinction between drawsContent and contentsVisible. So, for m_layer, these two 585 // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag 586 // so it is only given contentsVisible. 587 588 m_layer->setIsDrawable(m_drawsContent && m_contentsVisible); 589 590 if (m_contentsLayer) 591 m_contentsLayer->setIsDrawable(m_contentsVisible); 592 573 593 if (m_drawsContent) 574 594 m_layer->setNeedsDisplay(); … … 627 647 m_contentsLayer->setAnchorPoint(FloatPoint(0, 0)); 628 648 649 // It is necessary to update setIsDrawable as soon as we receive the new contentsLayer, for 650 // the correctness of early exit conditions in setDrawsContent() and setContentsVisible(). 651 m_contentsLayer->setIsDrawable(m_contentsVisible); 652 629 653 // Insert the content layer first. Video elements require this, because they have 630 654 // shadow content that must display in front of the video. 631 655 m_layer->insertChild(m_contentsLayer.get(), 0); 632 656 633 updateContentsRect();634 635 657 if (showDebugBorders()) { 636 658 m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180)); … … 656 678 } 657 679 658 bool GraphicsLayerChromium::drawsContent() const659 {660 return GraphicsLayer::drawsContent();661 }662 663 680 void GraphicsLayerChromium::paintContents(GraphicsContext& context, const IntRect& clip) 664 681 { -
trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
r103293 r103990 69 69 virtual void setMasksToBounds(bool); 70 70 virtual void setDrawsContent(bool); 71 virtual void setContentsVisible(bool); 71 72 virtual void setMaskLayer(GraphicsLayer*); 72 73 … … 98 99 99 100 // The following functions implement the CCLayerDelegate interface. 100 virtual bool drawsContent() const;101 101 virtual void paintContents(GraphicsContext&, const IntRect& clip); 102 102 … … 118 118 void updateMasksToBounds(); 119 119 void updateLayerPreserves3D(); 120 void updateLayer DrawsContent();120 void updateLayerIsDrawable(); 121 121 void updateLayerBackgroundColor(); 122 122 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r103944 r103990 66 66 , m_opacity(1.0) 67 67 , m_anchorPointZ(0) 68 , m_isDrawable(false) 68 69 , m_masksToBounds(false) 69 70 , m_opaque(false) … … 378 379 return; 379 380 m_doubleSided = doubleSided; 381 setNeedsCommit(); 382 } 383 384 void LayerChromium::setIsDrawable(bool isDrawable) 385 { 386 if (m_isDrawable == isDrawable) 387 return; 388 389 m_isDrawable = isDrawable; 380 390 setNeedsCommit(); 381 391 } -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r103944 r103990 60 60 public: 61 61 virtual ~CCLayerDelegate() { } 62 virtual bool drawsContent() const = 0;63 62 virtual void paintContents(GraphicsContext&, const IntRect& clip) = 0; 64 63 }; … … 155 154 void setDelegate(CCLayerDelegate* delegate) { m_delegate = delegate; } 156 155 156 void setIsDrawable(bool); 157 157 158 void setReplicaLayer(LayerChromium*); 158 159 LayerChromium* replicaLayer() const { return m_replicaLayer.get(); } 159 160 160 161 // These methods typically need to be overwritten by derived classes. 161 virtual bool drawsContent() const { return false; }162 virtual bool drawsContent() const { return m_isDrawable; } 162 163 virtual void paintContentsIfDirty() { } 163 164 virtual void idlePaintContentsIfDirty() { } … … 264 265 float m_opacity; 265 266 float m_anchorPointZ; 267 bool m_isDrawable; 266 268 bool m_masksToBounds; 267 269 bool m_opaque; -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h
r102250 r103990 38 38 public: 39 39 static PassRefPtr<PluginLayerChromium> create(CCLayerDelegate* = 0); 40 virtual bool drawsContent() const { return true; }41 40 virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&); 42 41 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r103972 r103990 151 151 bool TiledLayerChromium::drawsContent() const 152 152 { 153 if (! m_delegate)153 if (!LayerChromium::drawsContent() || !m_delegate) 154 154 return false; 155 155 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h
r103370 r103990 52 52 virtual PassRefPtr<CCLayerImpl> createCCLayerImpl(); 53 53 54 virtual bool drawsContent() const { return true; }55 56 54 private: 57 55 VideoLayerChromium(CCLayerDelegate*, VideoFrameProvider*); -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
r103264 r103990 67 67 bool WebGLLayerChromium::drawsContent() const 68 68 { 69 return (context() &&context()->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR);69 return LayerChromium::drawsContent() && context() && (context()->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR); 70 70 } 71 71 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r102838 r103990 189 189 { 190 190 writeIndent(ts, indent); 191 ts << "layer ID: " << m_layerId << "\n"; 192 193 writeIndent(ts, indent); 191 194 ts << "bounds: " << bounds().width() << ", " << bounds().height() << "\n"; 192 195 … … 202 205 ts << m_drawTransform.m31() << ", " << m_drawTransform.m32() << ", " << m_drawTransform.m33() << ", " << m_drawTransform.m34() << " // "; 203 206 ts << m_drawTransform.m41() << ", " << m_drawTransform.m42() << ", " << m_drawTransform.m43() << ", " << m_drawTransform.m44() << "\n"; 207 208 writeIndent(ts, indent); 209 ts << "drawsContent: " << (m_drawsContent ? "yes" : "no") << "\n"; 204 210 } 205 211 -
trunk/Source/WebKit/chromium/ChangeLog
r103988 r103990 1 2012-01-03 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Push drawsContent and contentsVisible into accelerated compositor 4 https://bugs.webkit.org/show_bug.cgi?id=71209 5 6 Reviewed by James Robinson. 7 8 * src/WebContentLayerImpl.cpp: 9 (WebKit::WebContentLayerImpl::WebContentLayerImpl): 10 (WebKit::WebContentLayerImpl::setDrawsContent): 11 * src/WebContentLayerImpl.h: 12 * src/WebExternalTextureLayerImpl.cpp: 13 (WebKit::WebExternalTextureLayerImpl::drawsContent): 14 * src/WebLayerImpl.cpp: 15 (WebKit::WebLayerImpl::WebLayerImpl): 16 * src/WebLayerImpl.h: 17 * tests/CCLayerTreeHostTest.cpp: 18 (WTF::ContentLayerChromiumWithUpdateTracking::ContentLayerChromiumWithUpdateTracking): 19 * tests/Canvas2DLayerChromiumTest.cpp: 20 * tests/LayerChromiumTest.cpp: 21 * tests/TiledLayerChromiumTest.cpp: 22 (WTF::FakeTiledLayerChromium::FakeTiledLayerChromium): 23 1 24 2012-01-03 Shawn Singh <shawnsingh@chromium.org> 2 25 -
trunk/Source/WebKit/chromium/src/WebContentLayerImpl.cpp
r103293 r103990 47 47 : ContentLayerChromium(this) 48 48 , m_contentClient(contentClient) 49 , m_drawsContent(true)50 49 { 50 setIsDrawable(true); 51 51 } 52 52 … … 58 58 void WebContentLayerImpl::setDrawsContent(bool drawsContent) 59 59 { 60 m_drawsContent = drawsContent; 61 setNeedsCommit(); 62 } 63 64 bool WebContentLayerImpl::drawsContent() const 65 { 66 return m_drawsContent; 60 setIsDrawable(drawsContent); 67 61 } 68 62 -
trunk/Source/WebKit/chromium/src/WebContentLayerImpl.h
r103293 r103990 38 38 39 39 void setDrawsContent(bool); 40 virtual bool drawsContent() const;41 40 42 41 protected: -
trunk/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp
r103293 r103990 52 52 bool WebExternalTextureLayerImpl::drawsContent() const 53 53 { 54 return !!textureId() ;54 return !!textureId() && LayerChromium::drawsContent(); 55 55 } 56 56 -
trunk/Source/WebKit/chromium/src/WebLayerImpl.cpp
r103293 r103990 39 39 : LayerChromium(this) 40 40 { 41 // Make sure that this layer does not draw content. This way we don't have to override 42 // the base class implementation of drawsContent(). 43 ASSERT(!drawsContent()); 41 44 } 42 45 … … 46 49 } 47 50 48 bool WebLayerImpl::drawsContent() const49 {50 return false;51 }52 53 51 void WebLayerImpl::paintContents(GraphicsContext&, const IntRect& clip) 54 52 { -
trunk/Source/WebKit/chromium/src/WebLayerImpl.h
r103293 r103990 39 39 WebLayerImpl(); 40 40 virtual ~WebLayerImpl(); 41 virtual bool drawsContent() const;42 41 virtual void paintContents(WebCore::GraphicsContext&, const WebCore::IntRect& clip); 43 42 }; -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r103293 r103990 920 920 } 921 921 922 virtual bool drawsContent() const { return true; }923 922 virtual bool preserves3D() { return false; } 924 923 … … 964 963 { 965 964 setBounds(IntSize(10, 10)); 965 setIsDrawable(true); 966 966 } 967 967 -
trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
r103293 r103990 124 124 125 125 RefPtr<Canvas2DLayerChromium> canvas = Canvas2DLayerChromium::create(mainContext.get(), size); 126 canvas->setIsDrawable(true); 126 127 setTextureManager(canvas.get(), textureManager.get()); 127 128 canvas->setBounds(IntSize(600, 300)); -
trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
r103293 r103990 437 437 } 438 438 439 // FIXME: need to add a test for getDescendantDrawsContent after resolving440 // some issues with LayerChromium::descendantDrawsContent().441 // see discussion on issue 67750442 443 439 TEST_F(LayerChromiumTest, checkSetNeedsDisplayCausesCorrectBehavior) 444 440 { -
trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
r103944 r103990 85 85 setTextureFormat(GraphicsContext3D::RGBA); 86 86 setBorderTexelOption(CCLayerTilingData::NoBorderTexels); 87 setIsDrawable(true); // So that we don't get false positives if any of these tests expect to return false from drawsContent() for other reasons. 87 88 } 88 89 virtual ~FakeTiledLayerChromium() { }
Note: See TracChangeset
for help on using the changeset viewer.