void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&) { #if PLATFORM(IOS) if (pthread_main_np()) WebThreadLock(); #endif { GraphicsContextStateSaver stateSaver(context); FloatPoint3D layerOrigin = platformCALayer->position(); context.translate(-layerOrigin.x(), -layerOrigin.y()); context.scale(FloatSize(m_scale, m_scale)); PlatformCALayer::RepaintRectList dirtyRects = PlatformCALayer::collectRectsToPaint(context.platformContext(), platformCALayer); PlatformCALayer::drawLayerContents(context.platformContext(), &m_controller.rootLayer(), dirtyRects); } int repaintCount = platformCALayerIncrementRepaintCount(platformCALayer); if (m_controller.rootLayer().owner()->platformCALayerShowRepaintCounter(0)) PlatformCALayer::drawRepaintIndicator(context.platformContext(), platformCALayer, repaintCount, cachedCGColor(m_controller.tileDebugBorderColor())); if (m_controller.scrollingPerformanceLoggingEnabled()) { FloatRect visiblePart(platformCALayer->position().x(), platformCALayer->position().y(), platformCALayer->bounds().size().width(), platformCALayer->bounds().size().height()); visiblePart.intersect(m_controller.visibleRect()); if (repaintCount == 1 && !visiblePart.isEmpty()) WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), blankPixelCount()); } }
unsigned TileController::blankPixelCountForTiles(const PlatformLayerList& tiles, const FloatRect& visibleRect, const IntPoint& tileTranslation) { Region paintedVisibleTiles; for (PlatformLayerList::const_iterator it = tiles.begin(), end = tiles.end(); it != end; ++it) { const PlatformLayer* tileLayer = it->get(); FloatRect visiblePart(CGRectOffset(PlatformCALayer::frameForLayer(tileLayer), tileTranslation.x(), tileTranslation.y())); visiblePart.intersect(visibleRect); if (!visiblePart.isEmpty()) paintedVisibleTiles.unite(enclosingIntRect(visiblePart)); } Region uncoveredRegion(enclosingIntRect(visibleRect)); uncoveredRegion.subtract(paintedVisibleTiles); return uncoveredRegion.totalArea(); }