WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Added update rect to CCLayerImpl also
bug-69441-20111014174124.patch (text/plain), 12.44 KB, created by
Shawn Singh
on 2011-10-14 17:41:25 PDT
(
hide
)
Description:
Added update rect to CCLayerImpl also
Filename:
MIME Type:
Creator:
Shawn Singh
Created:
2011-10-14 17:41:25 PDT
Size:
12.44 KB
patch
obsolete
>Subversion Revision: 97467 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 40c0e1c94cd66fac5b523e75e0d8d09b70faa591..930fedfb9dcf75c9fba0f4eaf1c861790540d5cb 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2011-10-14 Shawn Singh <shawnsingh@chromium.org> >+ >+ [chromium] Tracking update rects in LayerChromium and CCLayerImpl. >+ https://bugs.webkit.org/show_bug.cgi?id=69441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch does not do much on its own, but is just part 1 of a >+ string of other patches which will use these rects for >+ visualization and scissoring. The appropriate testing will be >+ associated with those patches. >+ >+ * platform/graphics/chromium/Canvas2DLayerChromium.cpp: >+ (WebCore::Canvas2DLayerChromium::updateCompositorResources): >+ * platform/graphics/chromium/LayerChromium.cpp: >+ (WebCore::LayerChromium::pushPropertiesTo): >+ * platform/graphics/chromium/LayerChromium.h: >+ * platform/graphics/chromium/TiledLayerChromium.cpp: >+ (WebCore::TiledLayerChromium::cleanupResources): >+ (WebCore::TiledLayerChromium::updateCompositorResources): >+ (WebCore::TiledLayerChromium::pushPropertiesTo): >+ (WebCore::TiledLayerChromium::prepareToUpdate): >+ * platform/graphics/chromium/TiledLayerChromium.h: >+ * platform/graphics/chromium/VideoLayerChromium.cpp: >+ (WebCore::VideoLayerChromium::updateCompositorResources): >+ * platform/graphics/chromium/WebGLLayerChromium.cpp: >+ (WebCore::WebGLLayerChromium::updateCompositorResources): >+ * platform/graphics/chromium/cc/CCLayerImpl.h: >+ (WebCore::CCLayerImpl::updateRect): >+ (WebCore::CCLayerImpl::setUpdateRect): >+ > 2011-10-14 Andreas Kling <kling@webkit.org> > > Unreviewed, actually remove StyleList.* after r97640. >diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp >index 0e0da804b61d6465f4142eca7ba2713ca575bb8d..fcac26296df8edc9848172d464659b4b0ad1247e 100644 >--- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp >@@ -79,6 +79,8 @@ void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D*, Textur > #endif > m_context->flush(); > } >+ >+ m_updateRect = FloatRect(FloatPoint(), bounds()); > resetNeedsDisplay(); > } > >diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >index fe2cd4eb15df4dd3ff6170b6aacdde0e90d32a38..9e7428074046c36ea9f1521d3c04e31b21b789d0 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >@@ -296,11 +296,15 @@ void LayerChromium::pushPropertiesTo(CCLayerImpl* layer) > layer->setScrollPosition(m_scrollPosition); > layer->setSublayerTransform(m_sublayerTransform); > layer->setTransform(m_transform); >+ layer->setUpdateRect(m_updateRect); > > if (maskLayer()) > maskLayer()->pushPropertiesTo(layer->maskLayer()); > if (replicaLayer()) > replicaLayer()->pushPropertiesTo(layer->replicaLayer()); >+ >+ // Reset any state that should be cleared for the next update. >+ m_updateRect = FloatRect(); > } > > PassRefPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() >diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.h b/Source/WebCore/platform/graphics/chromium/LayerChromium.h >index be0e79606bb293bc00fb3fe8dd2f25e636d8dbd9..33eb240f551d33fa602c9b2dad796f3fa54c2209 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.h >+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.h >@@ -208,8 +208,14 @@ protected: > // hold context-dependent resources such as textures. > virtual void cleanupResources(); > >+ // The dirty rect is the union of damaged regions that need repainting/updating. > FloatRect m_dirtyRect; > >+ // The update rect is the region of the compositor resource that was actually updated by the compositor. >+ // For layers that may do updating outside the compositor's control (i.e. plugin layers), this information >+ // is not available and the update rect will remain empty. >+ FloatRect m_updateRect; >+ > RefPtr<LayerChromium> m_maskLayer; > > friend class TreeSynchronizer; >diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >index af49c8c0a4daac555f876a44135462b7e4541de0..0a0d08850c922df928ab800af33c847630449a66 100644 >--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >@@ -89,7 +89,7 @@ void TiledLayerChromium::cleanupResources() > m_tiler.clear(); > m_unusedTiles.clear(); > m_paintRect = IntRect(); >- m_updateRect = IntRect(); >+ m_visibleContentRect = IntRect(); > } > > void TiledLayerChromium::updateTileSizeAndTilingOption() >@@ -154,11 +154,11 @@ void TiledLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) > void TiledLayerChromium::updateCompositorResources(GraphicsContext3D* context, TextureAllocator* allocator) > { > // Painting could cause compositing to get turned off, which may cause the tiler to become invalidated mid-update. >- if (m_skipsDraw || m_updateRect.isEmpty() || !m_tiler->numTiles()) >+ if (m_skipsDraw || m_visibleContentRect.isEmpty() || !m_tiler->numTiles()) > return; > > int left, top, right, bottom; >- m_tiler->contentRectToTileIndices(m_updateRect, left, top, right, bottom); >+ m_tiler->contentRectToTileIndices(m_visibleContentRect, left, top, right, bottom); > for (int j = top; j <= bottom; ++j) { > for (int i = left; i <= right; ++i) { > UpdatableTile* tile = tileAt(i, j); >@@ -207,6 +207,8 @@ void TiledLayerChromium::updateCompositorResources(GraphicsContext3D* context, T > tile->clearDirty(); > } > } >+ >+ m_updateRect = FloatRect(m_paintRect); > } > > void TiledLayerChromium::setTilingOption(TilingOption tilingOption) >@@ -244,6 +246,9 @@ void TiledLayerChromium::pushPropertiesTo(CCLayerImpl* layer) > > tiledLayer->syncTextureId(i, j, tile->texture()->textureId()); > } >+ >+ // Reset any state that should be cleared for the next update. >+ m_paintRect = IntRect(); > } > > TextureManager* TiledLayerChromium::textureManager() const >@@ -342,24 +347,24 @@ void TiledLayerChromium::protectTileTextures(const IntRect& contentRect) > } > } > >-void TiledLayerChromium::prepareToUpdate(const IntRect& contentRect) >+void TiledLayerChromium::prepareToUpdate(const IntRect& visibleContentRect) > { > ASSERT(m_tiler); > > m_skipsDraw = false; > >- if (contentRect.isEmpty()) { >- m_updateRect = IntRect(); >+ if (visibleContentRect.isEmpty()) { >+ m_visibleContentRect = IntRect(); > return; > } > > // Invalidate old tiles that were previously used but aren't in use this > // frame so that they can get reused for new tiles. >- invalidateTiles(contentRect); >- m_tiler->growLayerToContain(contentRect); >+ invalidateTiles(visibleContentRect); >+ m_tiler->growLayerToContain(visibleContentRect); > > if (!m_tiler->numTiles()) { >- m_updateRect = IntRect(); >+ m_visibleContentRect = IntRect(); > return; > } > >@@ -367,7 +372,7 @@ void TiledLayerChromium::prepareToUpdate(const IntRect& contentRect) > // the dirty regions currently being drawn. > IntRect dirtyLayerRect; > int left, top, right, bottom; >- m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom); >+ m_tiler->contentRectToTileIndices(visibleContentRect, left, top, right, bottom); > for (int j = top; j <= bottom; ++j) { > for (int i = left; i <= right; ++i) { > UpdatableTile* tile = tileAt(i, j); >@@ -390,7 +395,7 @@ void TiledLayerChromium::prepareToUpdate(const IntRect& contentRect) > // Due to borders, when the paint rect is extended to tile boundaries, it > // may end up overlapping more tiles than the original content rect. Record > // that original rect so we don't upload more tiles than necessary. >- m_updateRect = contentRect; >+ m_visibleContentRect = visibleContentRect; > > m_paintRect = m_tiler->layerRectToContentRect(dirtyLayerRect); > if (dirtyLayerRect.isEmpty()) >diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h >index 1e8494a9b7d32f261774280008a45c80f9cb903d..fc5f1d8446bb62823f72ba82c6adb4dcd2584103 100644 >--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h >+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h >@@ -66,9 +66,8 @@ protected: > // Set invalidations to be potentially repainted during update(). > void invalidateRect(const IntRect& contentRect); > // Prepare data needed to update textures that intersect with contentRect. >- void prepareToUpdate(const IntRect& contentRect); >- // Update invalid textures that intersect with contentRect provided in prepareToUpdate(). >- void updateRect(GraphicsContext3D*, LayerTextureUpdater*); >+ void prepareToUpdate(const IntRect& visibleContentRect); >+ > virtual void protectVisibleTileTextures(); > > private: >@@ -85,9 +84,11 @@ private: > > TextureManager* textureManager() const; > >- // State held between update and upload. >+ // Temporary state held between prepareToUpdate() and updateCompositorResources(). >+ IntRect m_visibleContentRect; >+ // State held between prepareToUpdate() and pushPropertiesTo(). This represents the area >+ // of the layer that is actually re-painted by WebKit. > IntRect m_paintRect; >- IntRect m_updateRect; > > // Tightly packed set of unused tiles. > Vector<RefPtr<UpdatableTile> > m_unusedTiles; >diff --git a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >index ace63088aa3bae21ce356abb687497aa156e4ffd..0eb6cfb8348a499edc9aacf90b38b9585280b024 100644 >--- a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >@@ -134,6 +134,7 @@ void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context, T > m_planes = frame->planes(); > ASSERT(m_planes <= MaxPlanes); > >+ m_updateRect = FloatRect(FloatPoint(), bounds()); > resetNeedsDisplay(); > > m_provider->putCurrentFrame(frame); >diff --git a/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp >index 32ba6a3bee5a024f55cc02762252b93b5804e0e4..5cfb66ac9c71d099a24fcba9074e9b7db86d4d7b 100644 >--- a/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp >@@ -90,6 +90,7 @@ void WebGLLayerChromium::updateCompositorResources(GraphicsContext3D* rendererCo > // > m_context->prepareTexture(); > m_context->markLayerComposited(); >+ m_updateRect = FloatRect(FloatPoint(), bounds()); > resetNeedsDisplay(); > m_textureUpdated = false; > } >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >index 15be75156c7780014498db6e478ad636708d8b60..39c6f8e10ba0f877b92afa130f4118434fa5eca4 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h >@@ -169,6 +169,8 @@ public: > void setScreenSpaceTransform(const TransformationMatrix& matrix) { m_screenSpaceTransform = matrix; } > const IntRect& drawableContentRect() const { return m_drawableContentRect; } > void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = rect; } >+ const FloatRect& updateRect() const { return m_updateRect; } >+ void setUpdateRect(const FloatRect& updateRect) { m_updateRect = updateRect; } > > String layerTreeAsText() const; > >@@ -256,6 +258,10 @@ private: > > // Hierarchical bounding rect containing the layer and its descendants. > IntRect m_drawableContentRect; >+ >+ // Rect indicating what was repainted/updated during update. >+ // Note that plugin layers bypass this and leave it empty. >+ FloatRect m_updateRect; > }; > > void sortLayers(Vector<RefPtr<CCLayerImpl> >::iterator first, Vector<RefPtr<CCLayerImpl> >::iterator end, CCLayerSorter*);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 69441
:
109982
|
110013
|
110084
|
110258
|
110435
|
110463
|
111114
|
111472