Changeset 109469 in webkit
- Timestamp:
- Mar 1, 2012 5:14:16 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109466 r109469 1 2012-03-01 James Robinson <jamesr@chromium.org> 2 3 [chromium] LayerChromium::contentChanged is redundant with setNeedsDisplay 4 https://bugs.webkit.org/show_bug.cgi?id=79708 5 6 Reviewed by Adrienne Walker. 7 8 Some layer types need special handling when they receive damage. WebGL layers need to know if their texture is 9 updated for clear-on-swap behavior and both WebGL and canvas 2d layers have rate limiting mechanisms tied to 10 receiving invalidations. This mechanism was implemented by LayerChromium::contentChanged(), but this is 11 redundant with setNeedsDisplay(). 12 13 Covered by existing tests. 14 15 * platform/graphics/chromium/Canvas2DLayerChromium.cpp: 16 (WebCore::Canvas2DLayerChromium::setNeedsDisplay): 17 * platform/graphics/chromium/Canvas2DLayerChromium.h: 18 (Canvas2DLayerChromium): 19 * platform/graphics/chromium/GraphicsLayerChromium.cpp: 20 (WebCore::GraphicsLayerChromium::setContentsNeedsDisplay): 21 * platform/graphics/chromium/LayerChromium.cpp: 22 (WebCore::LayerChromium::setNeedsDisplay): 23 * platform/graphics/chromium/LayerChromium.h: 24 (LayerChromium): 25 * platform/graphics/chromium/VideoLayerChromium.cpp: 26 (WebCore::VideoLayerChromium::setNeedsDisplay): 27 * platform/graphics/chromium/VideoLayerChromium.h: 28 (VideoLayerChromium): 29 * platform/graphics/chromium/WebGLLayerChromium.cpp: 30 (WebCore::WebGLLayerChromium::setNeedsDisplay): 31 * platform/graphics/chromium/WebGLLayerChromium.h: 32 (WebGLLayerChromium): 33 1 34 2012-03-01 James Robinson <jamesr@chromium.org> 2 35 -
trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
r108714 r109469 76 76 } 77 77 78 void Canvas2DLayerChromium:: contentChanged()78 void Canvas2DLayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect) 79 79 { 80 LayerChromium::setNeedsDisplayRect(dirtyRect); 81 80 82 if (layerTreeHost()) 81 83 layerTreeHost()->startRateLimiter(m_context); 82 83 m_updateRect = FloatRect(FloatPoint(), contentBounds());84 setNeedsDisplay();85 84 } 86 85 -
trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h
r106891 r109469 53 53 void setTextureId(unsigned); 54 54 55 virtual void contentChanged();55 virtual void setNeedsDisplayRect(const FloatRect&); 56 56 57 57 virtual bool drawsContent() const; -
trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
r109466 r109469 324 324 void GraphicsLayerChromium::setContentsNeedsDisplay() 325 325 { 326 if (m_contentsLayer) {326 if (m_contentsLayer) 327 327 m_contentsLayer->setNeedsDisplay(); 328 m_contentsLayer->contentChanged();329 }330 328 } 331 329 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r109466 r109469 488 488 void LayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect) 489 489 { 490 m_updateRect.unite(dirtyRect); 491 490 492 // Simply mark the contents as dirty. For non-root layers, the call to 491 493 // setNeedsCommit will schedule a fresh compositing pass. -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r109466 r109469 208 208 // Returns true if any of the layer's descendants has content to draw. 209 209 bool descendantDrawsContent(); 210 virtual void contentChanged() { }211 210 212 211 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost.get(); } -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp
r108886 r109469 53 53 } 54 54 55 void PluginLayerChromium::updateCompositorResources(GraphicsContext3D* rendererContext, CCTextureUpdater&)56 {57 if (!m_needsDisplay)58 return;59 60 // PluginLayers are updated externally (outside of the compositor).61 // |m_dirtyRect| covers the region that has changed since the last composite.62 m_updateRect = m_dirtyRect;63 m_dirtyRect = FloatRect();64 }65 66 55 PassOwnPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl() 67 56 { … … 111 100 } 112 101 113 void PluginLayerChromium::invalidateRect(const FloatRect& dirtyRect)114 {115 setNeedsDisplayRect(dirtyRect);116 m_dirtyRect.unite(dirtyRect);117 }118 119 102 } 120 103 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h
r108886 r109469 38 38 public: 39 39 static PassRefPtr<PluginLayerChromium> create(); 40 virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);41 40 42 41 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); … … 56 55 virtual void pushPropertiesTo(CCLayerImpl*); 57 56 58 void invalidateRect(const FloatRect& dirtyRect);59 60 57 protected: 61 58 PluginLayerChromium(); … … 68 65 int m_ioSurfaceHeight; 69 66 uint32_t m_ioSurfaceId; 70 FloatRect m_dirtyRect;71 67 }; 72 68 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
r108886 r109469 58 58 } 59 59 60 void VideoLayerChromium::contentChanged()61 {62 m_updateRect = FloatRect(FloatPoint(), contentBounds());63 setNeedsDisplay();64 }65 66 60 } // namespace WebCore 67 61 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h
r108886 r109469 51 51 virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl(); 52 52 53 void contentChanged();54 55 53 private: 56 54 explicit VideoLayerChromium(VideoFrameProvider*); -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
r105460 r109469 93 93 drawingBuffer()->publishToPlatformLayer(); 94 94 context()->markLayerComposited(); 95 m_updateRect = FloatRect(FloatPoint(), bounds());96 95 m_needsDisplay = false; 97 96 m_textureUpdated = false; … … 128 127 } 129 128 130 void WebGLLayerChromium:: contentChanged()129 void WebGLLayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect) 131 130 { 131 LayerChromium::setNeedsDisplayRect(dirtyRect); 132 132 133 m_textureUpdated = true; 134 133 135 // If WebGL commands are issued outside of a the animation callbacks, then use 134 136 // call rateLimitOffscreenContextCHROMIUM() to keep the context from getting too far ahead. -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
r105460 r109469 56 56 virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&); 57 57 virtual void pushPropertiesTo(CCLayerImpl*); 58 virtual void contentChanged();58 virtual void setNeedsDisplayRect(const FloatRect&); 59 59 bool paintRenderedResultsToCanvas(ImageBuffer*); 60 60 -
trunk/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp
r103970 r109469 69 69 void WebExternalTextureLayer::invalidateRect(const WebFloatRect& updateRect) 70 70 { 71 unwrap<WebExternalTextureLayerImpl>()-> invalidateRect(updateRect);71 unwrap<WebExternalTextureLayerImpl>()->setNeedsDisplayRect(updateRect); 72 72 } 73 73 -
trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
r108703 r109469 153 153 #if USE(ACCELERATED_COMPOSITING) 154 154 if (m_videoLayer && supportsAcceleratedRendering()) 155 m_videoLayer-> contentChanged();155 m_videoLayer->setNeedsDisplay(); 156 156 #endif 157 157 m_mediaPlayer->repaint(); -
trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
r107960 r109469 371 371 { 372 372 #if USE(ACCELERATED_COMPOSITING) 373 if (m_platformLayer .get())374 m_platformLayer-> invalidateRect(FloatRect(FloatPoint(), m_platformLayer->bounds()));373 if (m_platformLayer) 374 m_platformLayer->setNeedsDisplay(); 375 375 #endif 376 376 } -
trunk/Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
r108886 r109469 132 132 canvas->setTextureId(backTextureId); 133 133 134 canvas-> contentChanged();134 canvas->setNeedsDisplay(); 135 135 EXPECT_TRUE(canvas->needsDisplay()); 136 136 Region occludedScreenSpace;
Note: See TracChangeset
for help on using the changeset viewer.