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

Unified Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 1394263004: android webview: allow cc to fail hardware draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: damage before hardware to avoid invalidate-draw loop Created 5 years, 2 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 | « content/renderer/android/synchronous_compositor_output_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/android/synchronous_compositor_output_surface.cc
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
index 39dea1b080e33180bfcf8c393b575f806492dd42..b572e28a791a22cfb77c494af494d94c07620008 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -71,12 +71,12 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
registry_(registry),
registered_(false),
sync_client_(nullptr),
+ next_hardware_draw_needs_damage_(false),
current_sw_canvas_(nullptr),
memory_policy_(0u),
frame_swap_message_queue_(frame_swap_message_queue) {
thread_checker_.DetachFromThread();
DCHECK(registry_);
- capabilities_.draw_and_swap_full_viewport_every_frame = true;
capabilities_.adjust_deadline_for_parent = false;
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
@@ -195,7 +195,10 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
SetExternalDrawConstraints(adjusted_transform, viewport, clip,
viewport_rect_for_tile_priority,
transform_for_tile_priority, !hardware_draw);
- SetNeedsRedrawRect(gfx::Rect(viewport.size()));
+ if (!hardware_draw || next_hardware_draw_needs_damage_) {
+ next_hardware_draw_needs_damage_ = false;
+ SetNeedsRedrawRect(gfx::Rect(viewport.size()));
+ }
client_->OnDraw();
@@ -217,6 +220,10 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
cached_hw_viewport_rect_for_tile_priority_,
cached_hw_transform_for_tile_priority_,
resourceless_software_draw);
+ // This draw may have reset all damage, which would lead to subsequent
+ // incorrect hardware draw, so explicitly set damage for next hardware
+ // draw as well.
+ next_hardware_draw_needs_damage_ = true;
}
if (frame_holder_.get())
« no previous file with comments | « content/renderer/android/synchronous_compositor_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698