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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 264713014: Remove the composited path from WebViewImpl::paint(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: paint-compositor: 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..5c3795682cc68a9f64fae56ea60158453c45a04e 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1767,43 +1767,38 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect
canvas->writePixels(target, rect.x(), rect.y());
}
-void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions option)
+void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
enne (OOO) 2014/05/02 23:16:23 I do think this needs to be split into two functio
{
+ // Note: This method can be called on a composited WebView on OS(ANDROID)
+ // but this will hopefully be changed once the link disambiguation feature
+ // renders using the compositor.
#if !OS(ANDROID)
- // ReadbackFromCompositorIfAvailable is the only option available on non-Android.
- // Ideally, Android would always use ReadbackFromCompositorIfAvailable as well.
- ASSERT(option == ReadbackFromCompositorIfAvailable);
+ // This should only be used when compositing is not being used for this
+ // WebView, and it is painting into the recording of its parent.
+ ASSERT(!isAcceleratedCompositingActive());
#endif
- if (option == ReadbackFromCompositorIfAvailable && isAcceleratedCompositingActive()) {
- // If a canvas was passed in, we use it to grab a copy of the
- // freshly-rendered pixels.
- if (canvas) {
- // Clip rect to the confines of the rootLayerTexture.
- IntRect resizeRect(rect);
- resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeView->deviceViewportSize()));
- doPixelReadbackToCanvas(canvas, resizeRect);
- }
- } else {
- FrameView* view = page()->mainFrame()->view();
- PaintBehavior oldPaintBehavior = view->paintBehavior();
- if (isAcceleratedCompositingActive()) {
- ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent);
- view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers);
- }
+ FrameView* view = page()->mainFrame()->view();
+ PaintBehavior oldPaintBehavior = view->paintBehavior();
- double paintStart = currentTime();
- 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);
+ double paintStart = currentTime();
- if (isAcceleratedCompositingActive()) {
- ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent);
- view->setPaintBehavior(oldPaintBehavior);
- }
- }
+#if OS(ANDROID)
danakj 2014/05/02 23:12:53 This OS(ANDROID) stuff is a disaster. abarth: WDY
+ if (isAcceleratedCompositingActive())
+ view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers);
+#endif
+
+ PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque);
+
+#if OS(ANDROID)
+ if (isAcceleratedCompositingActive())
+ view->setPaintBehavior(oldPaintBehavior);
+#endif
+
+ 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);
}
bool WebViewImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback* callback)
« 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