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

Unified Diff: content/browser/android/in_process/synchronous_compositor_output_surface.cc

Issue 17553012: Force spontaneous draws into the SW path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/browser/android/in_process/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/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 38bf88b3283a41b11aa573dd5a8a3bc8608de40f..a9fcfb9aded0697ad3be40288326cd2f51e4f8ae 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
@@ -88,6 +88,7 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
routing_id_(routing_id),
needs_begin_frame_(false),
+ invoking_composite_(false),
did_swap_buffer_(false),
current_sw_canvas_(NULL) {
capabilities_.deferred_gl_initialization = true;
@@ -104,7 +105,11 @@ SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
}
bool SynchronousCompositorOutputSurface::ForcedDrawToSoftwareDevice() const {
- return current_sw_canvas_ != NULL;
+ // |current_sw_canvas_| indicates we're in a DemandDrawSw call. In addition
+ // |invoking_composite_| == false indicates an attempt to draw outside of
+ // the synchronous compositor's control: force it into SW path and hence to
+ // the null canvas (and will log a warning there).
+ return current_sw_canvas_ != NULL || !invoking_composite_;
}
bool SynchronousCompositorOutputSurface::BindToClient(
@@ -218,6 +223,7 @@ bool SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
void SynchronousCompositorOutputSurface::InvokeComposite(
gfx::Size damage_size) {
+ invoking_composite_ = true;
boliu 2013/06/21 22:40:14 Use base::AutoReset?
joth 2013/06/21 23:02:14 Done. Nice! Thought that existed, but I was searc
did_swap_buffer_ = false;
SetNeedsRedrawRect(gfx::Rect(damage_size));
if (needs_begin_frame_)
@@ -225,6 +231,7 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
if (did_swap_buffer_)
OnSwapBuffersComplete(NULL);
+ invoking_composite_ = false;
}
void SynchronousCompositorOutputSurface::PostCheckForRetroactiveBeginFrame() {
« no previous file with comments | « content/browser/android/in_process/synchronous_compositor_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698