Index: content/browser/android/in_process/synchronous_compositor_output_surface.cc |
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
index 682c530dc3938d61d0557ddb5e439a1998102c00..200e709478443a3eb1d2f7322e9e72e5b3234415 100644 |
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
@@ -200,9 +200,15 @@ SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) { |
surface_size_ = gfx::Size(canvas->getDeviceSize().width(), |
canvas->getDeviceSize().height()); |
- // Resourceless software draw does not need viewport_for_tiling. |
- gfx::Rect empty; |
- InvokeComposite(transform, clip, clip, empty, gfx::Transform(), false); |
+ // Pass in the cached hw viewport and transform for tile priority to avoid |
+ // tile thrashing when the WebView is alternating between hardware and |
+ // software draws. |
+ InvokeComposite(transform, |
+ clip, |
+ clip, |
+ cached_hw_viewport_rect_for_tile_priority_, |
+ cached_hw_transform_for_tile_priority_, |
+ false); |
return frame_holder_.Pass(); |
} |
@@ -239,14 +245,6 @@ void SynchronousCompositorOutputSurface::InvokeComposite( |
cached_hw_viewport_rect_for_tile_priority_ = |
viewport_rect_for_tile_priority; |
cached_hw_transform_for_tile_priority_ = transform_for_tile_priority; |
- } else { |
- bool resourceless_software_draw = false; |
- SetExternalDrawConstraints(cached_hw_transform_, |
boliu
2014/08/29 02:01:41
we still want this to restore draw viewports and w
hush (inactive)
2014/08/29 02:20:57
Done.
|
- cached_hw_viewport_, |
- cached_hw_clip_, |
- cached_hw_viewport_rect_for_tile_priority_, |
- cached_hw_transform_for_tile_priority_, |
- resourceless_software_draw); |
} |
if (frame_holder_.get()) |