Title: [174496] trunk/Source/WebCore
Revision
174496
Author
[email protected]
Date
2014-10-08 23:26:07 -0700 (Wed, 08 Oct 2014)

Log Message

[Mac] Show repaint counters in tile coverage map.
<https://webkit.org/b/137544>

Reviewed by Simon Fraser.

Add repaint counters to the tile layers in the "tiled scrolling
indicator" display. This will be helpful for diagnosing issues with
excessive tile repaints outside the visible viewport.

* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setNeedsDisplayInRect):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::drawTileMapContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174495 => 174496)


--- trunk/Source/WebCore/ChangeLog	2014-10-09 04:07:32 UTC (rev 174495)
+++ trunk/Source/WebCore/ChangeLog	2014-10-09 06:26:07 UTC (rev 174496)
@@ -1,3 +1,19 @@
+2014-10-08  Andreas Kling  <[email protected]>
+
+        [Mac] Show repaint counters in tile coverage map.
+        <https://webkit.org/b/137544>
+
+        Reviewed by Simon Fraser.
+
+        Add repaint counters to the tile layers in the "tiled scrolling
+        indicator" display. This will be helpful for diagnosing issues with
+        excessive tile repaints outside the visible viewport.
+
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::setNeedsDisplayInRect):
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::drawTileMapContents):
+
 2014-10-08  Myles C. Maxfield  <[email protected]>
 
         Unreviewed build fix after r174480. Broke iOS build.

Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (174495 => 174496)


--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2014-10-09 04:07:32 UTC (rev 174495)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2014-10-09 06:26:07 UTC (rev 174496)
@@ -95,6 +95,7 @@
     tileGrid().setNeedsDisplayInRect(rect);
     if (m_zoomedOutTileGrid)
         m_zoomedOutTileGrid->dropTilesInRect(rect);
+    updateTileCoverageMap();
 }
 
 void TileController::setContentsScale(float scale)

Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (174495 => 174496)


--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2014-10-09 04:07:32 UTC (rev 174495)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2014-10-09 06:26:07 UTC (rev 174496)
@@ -31,6 +31,7 @@
 #include "PlatformCALayer.h"
 #include "TileController.h"
 #include <wtf/MainThread.h>
+#include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
 #include "TileControllerMemoryHandlerIOS.h"
@@ -633,6 +634,21 @@
         CGRect frame = CGRectMake(tileLayer->position().x(), tileLayer->position().y(), tileLayer->bounds().size().width(), tileLayer->bounds().size().height());
         CGContextFillRect(context, frame);
         CGContextStrokeRect(context, frame);
+
+        CGContextSetRGBFillColor(context, 0, 0, 0, 0.5);
+
+        String repaintCount = String::number(m_tileRepaintCounts.get(tileLayer));
+
+        CGContextSaveGState(context);
+        CGContextSetTextMatrix(context, CGAffineTransformMakeScale(3, -3));
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+        CGContextSelectFont(context, "Helvetica", 58, kCGEncodingMacRoman);
+        CGContextShowTextAtPoint(context, frame.origin.x + 64, frame.origin.y + 192, repaintCount.ascii().data(), repaintCount.length());
+#pragma clang diagnostic pop
+
+        CGContextRestoreGState(context);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to