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

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

Issue 16833003: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
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 7613168adfd70901b16776a56a58c042b8d6bdaf..251e6ddee97e07e2f910a2c9097c1c774dac558d 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
@@ -124,6 +124,7 @@ void SynchronousCompositorOutputSurface::Reshape(
void SynchronousCompositorOutputSurface::SetNeedsBeginFrame(
bool enable) {
DCHECK(CalledOnValidThread());
+ cc::OutputSurface::SetNeedsBeginFrame(enable);
needs_begin_frame_ = enable;
SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate();
if (delegate)
@@ -138,6 +139,7 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
}
// TODO(joth): Route page scale to the client, see http://crbug.com/237006
did_swap_buffer_ = true;
+ DidSwapBuffers();
}
namespace {
@@ -150,7 +152,7 @@ void AdjustTransformForClip(gfx::Transform* transform, gfx::Rect clip) {
bool SynchronousCompositorOutputSurface::InitializeHwDraw() {
DCHECK(CalledOnValidThread());
- DCHECK(client_);
+ DCHECK(HasClient());
DCHECK(!context3d_);
// TODO(boliu): Get a context provider in constructor and pass here.
@@ -163,7 +165,7 @@ bool SynchronousCompositorOutputSurface::DemandDrawHw(
const gfx::Transform& transform,
gfx::Rect clip) {
DCHECK(CalledOnValidThread());
- DCHECK(client_);
+ DCHECK(HasClient());
DCHECK(context3d());
// Force a GL state restore next time a GLContextVirtual is made current.
@@ -177,7 +179,7 @@ bool SynchronousCompositorOutputSurface::DemandDrawHw(
gfx::Transform adjusted_transform = transform;
AdjustTransformForClip(&adjusted_transform, clip);
surface_size_ = surface_size;
- client_->SetExternalDrawConstraints(adjusted_transform, clip);
+ SetExternalDrawConstraints(adjusted_transform, clip);
InvokeComposite(clip.size());
// TODO(boliu): Check if context is lost here.
@@ -201,7 +203,7 @@ bool SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
surface_size_ = gfx::Size(canvas->getDeviceSize().width(),
canvas->getDeviceSize().height());
- client_->SetExternalDrawConstraints(transform, clip);
+ SetExternalDrawConstraints(transform, clip);
InvokeComposite(clip.size());
@@ -212,12 +214,12 @@ bool SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) {
void SynchronousCompositorOutputSurface::InvokeComposite(
gfx::Size damage_size) {
did_swap_buffer_ = false;
- client_->SetNeedsRedrawRect(gfx::Rect(damage_size));
+ SetNeedsRedrawRect(gfx::Rect(damage_size));
if (needs_begin_frame_)
- client_->BeginFrame(base::TimeTicks::Now());
+ BeginFrame(base::TimeTicks::Now());
if (did_swap_buffer_)
- client_->OnSwapBuffersComplete(NULL);
+ OnSwapBuffersComplete(NULL);
}
// Not using base::NonThreadSafe as we want to enforce a more exacting threading
« no previous file with comments | « chrome/test/perf/rendering/latency_tests.cc ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698