Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1624)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 269723008: Add a WebWidget::paintCompositedDeprecated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebWidget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index c7bd60281f12277fc42607777511075a526ae111..34751cd5717cb692e1a1d5fbcfc5142e4a080a34 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1806,6 +1806,29 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions opt
}
}
+#if OS(ANDROID)
+void WebViewImpl::paintCompositedDeprecated(WebCanvas* canvas, const WebRect& rect, PaintOptions option)
enne (OOO) 2014/05/02 23:34:45 Does this even compile? Looks like your definition
danakj 2014/05/02 23:36:07 Oops, probly not, was going to let bots tell me :)
+{
+ // Note: This method exists on OS(ANDROID) and will hopefully be
+ // removed once the link disambiguation feature renders using
+ // the compositor.
+ ASSERT(isAcceleratedCompositingActive());
+
+ FrameView* view = page()->mainFrame()->view();
+ PaintBehavior oldPaintBehavior = view->paintBehavior();
+ view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers);
+
+ double paintStart = currentTime();
enne (OOO) 2014/05/02 23:34:45 This duplicated timing code makes me a little sad,
danakj 2014/05/02 23:36:07 I was going to make this call paint() but I want p
+ PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque);
+ double paintEnd = currentTime();
+ double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart);
+ blink::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30);
+ blink::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30);
+
+ view->setPaintBehavior(oldPaintBehavior);
+}
+#endif
+
bool WebViewImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback* callback)
{
if (!isAcceleratedCompositingActive())
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698