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

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

Issue 15002007: Delegate root layer scroll offset to android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/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 1c73f3d3ae3c630c7e8cee995490bfbb2c7f474c..afb7073ec3506656eb8cd01ab78c00a3ccacd611 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -87,21 +87,18 @@ class SynchronousCompositorOutputSurface::SoftwareDevice
};
SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
- int32 routing_id)
- : cc::OutputSurface(CreateWebGraphicsContext3D(),
- scoped_ptr<cc::SoftwareOutputDevice>(
- new SoftwareDevice(this))),
- compositor_client_(NULL),
- routing_id_(routing_id),
+ Delegate* delegate)
+ : cc::OutputSurface(
+ CreateWebGraphicsContext3D(),
+ scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))),
+ delegate_(delegate),
vsync_enabled_(false),
did_swap_buffer_(false),
- current_sw_canvas_(NULL) {
-}
+ current_sw_canvas_(NULL) {}
SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
DCHECK(CalledOnValidThread());
- if (compositor_client_)
- compositor_client_->DidDestroyCompositor(this);
+ delegate_->DidDestroyCompositor();
}
bool SynchronousCompositorOutputSurface::ForcedDrawToSoftwareDevice() const {
@@ -113,8 +110,7 @@ bool SynchronousCompositorOutputSurface::BindToClient(
DCHECK(CalledOnValidThread());
if (!cc::OutputSurface::BindToClient(surface_client))
return false;
- GetContentClient()->renderer()->DidCreateSynchronousCompositor(routing_id_,
- this);
+ delegate_->DidCreateSynchronousCompositor();
return true;
}
@@ -132,7 +128,7 @@ void SynchronousCompositorOutputSurface::EnableVSyncNotification(
bool enable_vsync) {
DCHECK(CalledOnValidThread());
vsync_enabled_ = enable_vsync;
- UpdateCompositorClientSettings();
+ delegate_->SetContinuousInvalidate(enable_vsync);
}
void SynchronousCompositorOutputSurface::SwapBuffers(
@@ -141,13 +137,6 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
did_swap_buffer_ = true;
}
-void SynchronousCompositorOutputSurface::SetClient(
- SynchronousCompositorClient* compositor_client) {
- DCHECK(CalledOnValidThread());
- compositor_client_ = compositor_client;
- UpdateCompositorClientSettings();
-}
-
bool SynchronousCompositorOutputSurface::IsHwReady() {
return context3d() != NULL;
}
@@ -200,12 +189,6 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
client_->DidVSync(base::TimeTicks::Now());
}
-void SynchronousCompositorOutputSurface::UpdateCompositorClientSettings() {
- if (compositor_client_) {
- compositor_client_->SetContinuousInvalidate(vsync_enabled_);
- }
-}
-
// Not using base::NonThreadSafe as we want to enforce a more exacting threading
// requirement: SynchronousCompositorOutputSurface() must only be used by
// embedders that supply their own compositor loop via

Powered by Google App Engine
This is Rietveld 408576698