Title: [141065] trunk/Source/WebKit2
Revision
141065
Author
commit-qu...@webkit.org
Date
2013-01-28 23:44:58 -0800 (Mon, 28 Jan 2013)

Log Message

Coordinated Graphics: Refactor code related to debug border and repaint count.
https://bugs.webkit.org/show_bug.cgi?id=107910

Patch by Huang Dongsung <luxte...@company100.net> on 2013-01-28
Reviewed by Noam Rosenthal.

There are two big changes:
1. CoordinatedGraphicsLayer sends debugging visuals to UI Process.
2. When updating a backing store, increment a repaint count.

In addition, we don't use QT_WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS
environment. EFL, GTK and QT will use WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS
after http://webkit.org/b/107198.

* Shared/CoordinatedGraphics/CoordinatedLayerInfo.h:
(WebKit::CoordinatedLayerInfo::CoordinatedLayerInfo):
(CoordinatedLayerInfo):
* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStore::removeAllTiles):
(WebKit::CoordinatedBackingStore::updateTile):
(WebKit::CoordinatedBackingStore::texture):
(WebKit::CoordinatedBackingStore::paintTilesToTextureMapper):
(WebKit::CoordinatedBackingStore::adjustedTransformForRect):
(WebKit::CoordinatedBackingStore::paintToTextureMapper):
(WebKit):
(WebKit::CoordinatedBackingStore::drawBorder):
    Override TextureMapperPlatformLayer::drawBorder() to draw the border
    for each tile.
(WebKit::CoordinatedBackingStore::drawRepaintCounter):
(WebKit::CoordinatedBackingStore::commitTileOperations):
* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h:
(WebKit::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
(CoordinatedBackingStoreTile):
(CoordinatedBackingStore):
(WebKit::CoordinatedBackingStore::rect):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
(WebKit::CoordinatedLayerTreeHostProxy::setLayerRepaintCount):
(WebKit):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
(CoordinatedLayerTreeHostProxy):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::setLayerRepaintCount):
(WebKit):
(WebKit::LayerTreeRenderer::setLayerState):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
(WebCore):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::setDebugBorder):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayerClient):
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::setLayerRepaintCount):
(WebKit):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141064 => 141065)


--- trunk/Source/WebKit2/ChangeLog	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-29 07:44:58 UTC (rev 141065)
@@ -1,3 +1,66 @@
+2013-01-28  Huang Dongsung  <luxte...@company100.net>
+
+        Coordinated Graphics: Refactor code related to debug border and repaint count.
+        https://bugs.webkit.org/show_bug.cgi?id=107910
+
+        Reviewed by Noam Rosenthal.
+
+        There are two big changes:
+        1. CoordinatedGraphicsLayer sends debugging visuals to UI Process.
+        2. When updating a backing store, increment a repaint count.
+
+        In addition, we don't use QT_WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS
+        environment. EFL, GTK and QT will use WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS
+        after http://webkit.org/b/107198.
+
+        * Shared/CoordinatedGraphics/CoordinatedLayerInfo.h:
+        (WebKit::CoordinatedLayerInfo::CoordinatedLayerInfo):
+        (CoordinatedLayerInfo):
+        * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
+        (WebKit::CoordinatedBackingStore::removeAllTiles):
+        (WebKit::CoordinatedBackingStore::updateTile):
+        (WebKit::CoordinatedBackingStore::texture):
+        (WebKit::CoordinatedBackingStore::paintTilesToTextureMapper):
+        (WebKit::CoordinatedBackingStore::adjustedTransformForRect):
+        (WebKit::CoordinatedBackingStore::paintToTextureMapper):
+        (WebKit):
+        (WebKit::CoordinatedBackingStore::drawBorder):
+            Override TextureMapperPlatformLayer::drawBorder() to draw the border
+            for each tile.
+        (WebKit::CoordinatedBackingStore::drawRepaintCounter):
+        (WebKit::CoordinatedBackingStore::commitTileOperations):
+        * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h:
+        (WebKit::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
+        (CoordinatedBackingStoreTile):
+        (CoordinatedBackingStore):
+        (WebKit::CoordinatedBackingStore::rect):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
+        (WebKit::CoordinatedLayerTreeHostProxy::setLayerRepaintCount):
+        (WebKit):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
+        (CoordinatedLayerTreeHostProxy):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::setLayerRepaintCount):
+        (WebKit):
+        (WebKit::LayerTreeRenderer::setLayerState):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+        (LayerTreeRenderer):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
+        (WebCore):
+        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
+        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
+        (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
+        (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
+        (CoordinatedGraphicsLayerClient):
+        (CoordinatedGraphicsLayer):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::setLayerRepaintCount):
+        (WebKit):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+
 2013-01-28  Sam Weinig  <s...@webkit.org>
 
         Remove support from ArgumentEncoder for deprecated encode functions

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedLayerInfo.h (141064 => 141065)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedLayerInfo.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedLayerInfo.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -43,6 +43,7 @@
         , mask(InvalidCoordinatedLayerID)
         , imageID(InvalidCoordinatedImageBackingID)
         , opacity(0)
+        , debugBorderWidth(0)
         , flags(0) { }
 
     CoordinatedLayerID replica;
@@ -57,6 +58,8 @@
     WebCore::IntRect contentsRect;
     float opacity;
     WebCore::Color solidColor;
+    WebCore::Color debugBorderColor;
+    float debugBorderWidth;
 
     union {
         struct {
@@ -68,6 +71,8 @@
             bool preserves3D : 1;
             bool isRootLayer: 1;
             bool fixedToViewport : 1;
+            bool showDebugBorders : 1;
+            bool showRepaintCounter : 1;
         };
         unsigned flags;
     };

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp	2013-01-29 07:44:58 UTC (rev 141065)
@@ -79,23 +79,22 @@
 
 void CoordinatedBackingStore::removeAllTiles()
 {
-    HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator end = m_tiles.end();
-    for (HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it)
+    CoordinatedBackingStoreTileMap::iterator end = m_tiles.end();
+    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it)
         m_tilesToRemove.add(it->key);
 }
 
 void CoordinatedBackingStore::updateTile(uint32_t id, const IntRect& sourceRect, const IntRect& tileRect, PassRefPtr<CoordinatedSurface> backBuffer, const IntPoint& offset)
 {
-    HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator it = m_tiles.find(id);
+    CoordinatedBackingStoreTileMap::iterator it = m_tiles.find(id);
     ASSERT(it != m_tiles.end());
-    it->value.incrementRepaintCount();
     it->value.setBackBuffer(tileRect, sourceRect, backBuffer, offset);
 }
 
 PassRefPtr<BitmapTexture> CoordinatedBackingStore::texture() const
 {
-    HashMap<uint32_t, CoordinatedBackingStoreTile>::const_iterator end = m_tiles.end();
-    for (HashMap<uint32_t, CoordinatedBackingStoreTile>::const_iterator it = m_tiles.begin(); it != end; ++it) {
+    CoordinatedBackingStoreTileMap::const_iterator end = m_tiles.end();
+    for (CoordinatedBackingStoreTileMap::const_iterator it = m_tiles.begin(); it != end; ++it) {
         RefPtr<BitmapTexture> texture = it->value.texture();
         if (texture)
             return texture;
@@ -109,28 +108,15 @@
     m_size = size;
 }
 
-static bool shouldShowTileDebugVisuals()
+void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, BitmapTexture* mask, const FloatRect& rect)
 {
-#if PLATFORM(QT)
-    return (qgetenv("QT_WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS") == "1");
-#elif USE(CAIRO)
-    return (String(getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS")) == "1");
-#endif
-    return false;
+    for (size_t i = 0; i < tiles.size(); ++i)
+        tiles[i]->paint(textureMapper, transform, opacity, mask, calculateExposedTileEdges(rect, tiles[i]->rect()));
 }
 
-void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, BitmapTexture* mask, const FloatRect& rect)
+TransformationMatrix CoordinatedBackingStore::adjustedTransformForRect(const FloatRect& targetRect)
 {
-    for (size_t i = 0; i < tiles.size(); ++i) {
-        TextureMapperTile* tile = tiles[i];
-        tile->paint(textureMapper, transform, opacity, mask, calculateExposedTileEdges(rect, tile->rect()));
-        static bool shouldDebug = shouldShowTileDebugVisuals();
-        if (!shouldDebug)
-            continue;
-
-        textureMapper->drawBorder(Color(0xFF, 0, 0), 2, tile->rect(), transform);
-        textureMapper->drawRepaintCounter(static_cast<CoordinatedBackingStoreTile*>(tile)->repaintCount(), 8, tile->rect().location(), transform);
-    }
+    return TransformationMatrix::rectToRect(rect(), targetRect);
 }
 
 void CoordinatedBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask)
@@ -143,9 +129,9 @@
     Vector<TextureMapperTile*> previousTilesToPaint;
 
     // We have to do this every time we paint, in case the opacity has changed.
-    HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator end = m_tiles.end();
+    CoordinatedBackingStoreTileMap::iterator end = m_tiles.end();
     FloatRect coveredRect;
-    for (HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it) {
+    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it) {
         CoordinatedBackingStoreTile& tile = it->value;
         if (!tile.texture())
             continue;
@@ -164,16 +150,30 @@
         previousTilesToPaint.append(&tile);
     }
 
-    FloatRect rectOnContents(FloatPoint::zero(), m_size);
-    TransformationMatrix adjustedTransform = transform;
     // targetRect is on the contents coordinate system, so we must compare two rects on the contents coordinate system.
     // See TiledBackingStore.
-    adjustedTransform.multiply(TransformationMatrix::rectToRect(rectOnContents, targetRect));
+    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
 
-    paintTilesToTextureMapper(previousTilesToPaint, textureMapper, adjustedTransform, opacity, mask, rectOnContents);
-    paintTilesToTextureMapper(tilesToPaint, textureMapper, adjustedTransform, opacity, mask, rectOnContents);
+    paintTilesToTextureMapper(previousTilesToPaint, textureMapper, adjustedTransform, opacity, mask, rect());
+    paintTilesToTextureMapper(tilesToPaint, textureMapper, adjustedTransform, opacity, mask, rect());
 }
 
+void CoordinatedBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
+{
+    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
+    CoordinatedBackingStoreTileMap::iterator end = m_tiles.end();
+    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it)
+        textureMapper->drawBorder(borderColor, borderWidth, it->value.rect(), adjustedTransform);
+}
+
+void CoordinatedBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
+{
+    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
+    CoordinatedBackingStoreTileMap::iterator end = m_tiles.end();
+    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it)
+        textureMapper->drawRepaintCounter(repaintCount, borderColor, it->value.rect().location(), adjustedTransform);
+}
+
 void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper)
 {
     HashSet<uint32_t>::iterator tilesToRemoveEnd = m_tilesToRemove.end();
@@ -181,8 +181,8 @@
         m_tiles.remove(*it);
     m_tilesToRemove.clear();
 
-    HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator tilesEnd = m_tiles.end();
-    for (HashMap<uint32_t, CoordinatedBackingStoreTile>::iterator it = m_tiles.begin(); it != tilesEnd; ++it)
+    CoordinatedBackingStoreTileMap::iterator tilesEnd = m_tiles.end();
+    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != tilesEnd; ++it)
         it->value.swapBuffers(textureMapper);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -36,13 +36,10 @@
     explicit CoordinatedBackingStoreTile(float scale = 1)
         : TextureMapperTile(WebCore::FloatRect())
         , m_scale(scale)
-        , m_repaintCount(0)
     {
     }
 
     inline float scale() const { return m_scale; }
-    inline void incrementRepaintCount() { ++m_repaintCount; }
-    inline int repaintCount() const { return m_repaintCount; }
     void swapBuffers(WebCore::TextureMapper*);
     void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, PassRefPtr<CoordinatedSurface> buffer, const WebCore::IntPoint&);
 
@@ -52,7 +49,6 @@
     WebCore::IntRect m_tileRect;
     WebCore::IntPoint m_surfaceOffset;
     float m_scale;
-    int m_repaintCount;
 };
 
 class CoordinatedBackingStore : public WebCore::TextureMapperBackingStore {
@@ -66,14 +62,19 @@
     PassRefPtr<WebCore::BitmapTexture> texture() const;
     void setSize(const WebCore::FloatSize&);
     virtual void paintToTextureMapper(WebCore::TextureMapper*, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float, WebCore::BitmapTexture*);
+    virtual void drawBorder(WebCore::TextureMapper*, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) OVERRIDE;
+    virtual void drawRepaintCounter(WebCore::TextureMapper*, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) OVERRIDE;
 
 private:
     CoordinatedBackingStore()
         : m_scale(1.)
     { }
     void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper*, const WebCore::TransformationMatrix&, float, WebCore::BitmapTexture*, const WebCore::FloatRect&);
+    WebCore::TransformationMatrix adjustedTransformForRect(const WebCore::FloatRect&);
+    WebCore::FloatRect rect() const { return WebCore::FloatRect(WebCore::FloatPoint::zero(), m_size); }
 
-    HashMap<uint32_t, CoordinatedBackingStoreTile> m_tiles;
+    typedef HashMap<uint32_t, CoordinatedBackingStoreTile> CoordinatedBackingStoreTileMap;
+    CoordinatedBackingStoreTileMap m_tiles;
     HashSet<uint32_t> m_tilesToRemove;
     WebCore::FloatSize m_size;
     float m_scale;

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-29 07:44:58 UTC (rev 141065)
@@ -242,6 +242,11 @@
 }
 #endif
 
+void CoordinatedLayerTreeHostProxy::setLayerRepaintCount(CoordinatedLayerID id, int value)
+{
+    dispatchUpdate(bind(&LayerTreeRenderer::setLayerRepaintCount, m_renderer.get(), id, value));
+}
+
 void CoordinatedLayerTreeHostProxy::purgeBackingStores()
 {
     m_surfaces.clear();

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -85,6 +85,7 @@
     void syncCanvas(CoordinatedLayerID, uint32_t frontBuffer);
     void destroyCanvas(CoordinatedLayerID);
 #endif
+    void setLayerRepaintCount(CoordinatedLayerID, int value);
     void purgeBackingStores();
     LayerTreeRenderer* layerTreeRenderer() const { return m_renderer.get(); }
     void setLayerAnimations(CoordinatedLayerID, const WebCore::GraphicsLayerAnimations&);

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in	2013-01-29 07:44:58 UTC (rev 141065)
@@ -55,6 +55,8 @@
     DestroyCanvas(uint32_t id)
 #endif
 
+    SetLayerRepaintCount(uint32_t layerID, int value)
+
     SetBackgroundColor(WebCore::Color color)
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-29 07:44:58 UTC (rev 141065)
@@ -255,6 +255,12 @@
 }
 #endif
 
+void LayerTreeRenderer::setLayerRepaintCount(CoordinatedLayerID id, int value)
+{
+    GraphicsLayer* layer = layerByID(id);
+    toGraphicsLayerTextureMapper(layer)->setRepaintCount(value);
+}
+
 void LayerTreeRenderer::setLayerChildren(CoordinatedLayerID id, const Vector<CoordinatedLayerID>& childIDs)
 {
     GraphicsLayer* layer = layerByID(id);
@@ -333,6 +339,9 @@
     layer->setDrawsContent(layerInfo.drawsContent);
     layer->setContentsVisible(layerInfo.contentsVisible);
     toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport);
+    layer->setShowDebugBorder(layerInfo.showDebugBorders);
+    layer->setDebugBorder(layerInfo.debugBorderColor, layerInfo.debugBorderWidth);
+    layer->setShowRepaintCounter(layerInfo.showRepaintCounter);
 
     if (layerInfo.fixedToViewport)
         m_fixedLayers.add(id, layer);

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h (141064 => 141065)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -78,6 +78,7 @@
     void syncCanvas(CoordinatedLayerID, uint32_t frontBuffer);
     void destroyCanvas(CoordinatedLayerID);
 #endif
+    void setLayerRepaintCount(CoordinatedLayerID, int value);
 
     void detach();
     void appendUpdate(const Function<void()>&);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp (141064 => 141065)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2013-01-29 07:44:58 UTC (rev 141065)
@@ -371,6 +371,24 @@
     didChangeLayerState();
 }
 
+void CoordinatedGraphicsLayer::setShowDebugBorder(bool show)
+{
+    if (isShowingDebugBorder() == show)
+        return;
+
+    GraphicsLayer::setShowDebugBorder(show);
+    didChangeLayerState();
+}
+
+void CoordinatedGraphicsLayer::setShowRepaintCounter(bool show)
+{
+    if (isShowingRepaintCounter() == show)
+        return;
+
+    GraphicsLayer::setShowRepaintCounter(show);
+    didChangeLayerState();
+}
+
 void CoordinatedGraphicsLayer::setContentsToImage(Image* image)
 {
     NativeImagePtr newNativeImagePtr = image ? image->nativeImageForCurrentFrame() : 0;
@@ -550,9 +568,21 @@
     m_layerInfo.pos = m_adjustedPosition;
     m_layerInfo.size = m_adjustedSize;
 
+    m_layerInfo.showDebugBorders = isShowingDebugBorder();
+    if (m_layerInfo.showDebugBorders)
+        updateDebugIndicators();
+    m_layerInfo.showRepaintCounter = isShowingRepaintCounter();
+
     m_coordinator->syncLayerState(m_id, m_layerInfo);
 }
 
+void CoordinatedGraphicsLayer::setDebugBorder(const Color& color, float width)
+{
+    ASSERT(m_layerInfo.showDebugBorders);
+    m_layerInfo.debugBorderColor = color;
+    m_layerInfo.debugBorderWidth = width;
+}
+
 void CoordinatedGraphicsLayer::syncAnimations()
 {
     if (!m_shouldSyncAnimations)
@@ -698,8 +728,10 @@
     paintGraphicsLayerContents(*context, rect);
 }
 
-void CoordinatedGraphicsLayer::tiledBackingStorePaintEnd(const Vector<IntRect>& /* updatedRects */)
+void CoordinatedGraphicsLayer::tiledBackingStorePaintEnd(const Vector<IntRect>& updatedRects)
 {
+    if (isShowingRepaintCounter() && !updatedRects.isEmpty())
+        m_coordinator->setLayerRepaintCount(id(), incrementRepaintCount());
 }
 
 void CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation()

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h (141064 => 141065)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -71,6 +71,8 @@
     virtual void destroyCanvas(CoordinatedLayerID) = 0;
 #endif
 
+    virtual void setLayerRepaintCount(CoordinatedLayerID, int) = 0;
+
     virtual void setLayerAnimations(CoordinatedLayerID, const WebCore::GraphicsLayerAnimations&) = 0;
 
     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*) = 0;
@@ -112,6 +114,8 @@
     virtual void setContentsRect(const IntRect&) OVERRIDE;
     virtual void setContentsToImage(Image*) OVERRIDE;
     virtual void setContentsToSolidColor(const Color&) OVERRIDE;
+    virtual void setShowDebugBorder(bool) OVERRIDE;
+    virtual void setShowRepaintCounter(bool) OVERRIDE;
     virtual bool shouldDirectlyCompositeImage(Image*) const OVERRIDE;
     virtual void setContentsToCanvas(PlatformLayer*) OVERRIDE;
     virtual void setMaskLayer(GraphicsLayer*) OVERRIDE;
@@ -166,6 +170,8 @@
     bool hasPendingVisibleChanges();
 
 private:
+    virtual void setDebugBorder(const Color&, float width) OVERRIDE;
+
     bool fixedToViewport() const { return m_fixedToViewport; }
 
     void didChangeLayerState();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (141064 => 141065)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-01-29 07:44:58 UTC (rev 141065)
@@ -391,6 +391,11 @@
 }
 #endif
 
+void CoordinatedLayerTreeHost::setLayerRepaintCount(CoordinatedLayerID id, int value)
+{
+    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::SetLayerRepaintCount(id, value));
+}
+
 #if ENABLE(CSS_FILTERS)
 void CoordinatedLayerTreeHost::syncLayerFilters(CoordinatedLayerID id, const FilterOperations& filters)
 {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h (141064 => 141065)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h	2013-01-29 07:40:28 UTC (rev 141064)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h	2013-01-29 07:44:58 UTC (rev 141065)
@@ -101,6 +101,7 @@
     virtual void syncCanvas(CoordinatedLayerID, WebCore::PlatformLayer*) OVERRIDE;
     virtual void destroyCanvas(CoordinatedLayerID) OVERRIDE;
 #endif
+    virtual void setLayerRepaintCount(CoordinatedLayerID, int) OVERRIDE;
     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*);
     virtual void syncFixedLayers();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to