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

Unified Diff: content/renderer/android/synchronous_compositor_impl.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_impl.cc
diff --git a/content/renderer/android/synchronous_compositor_impl.cc b/content/renderer/android/synchronous_compositor_impl.cc
index 5b54c27fe72e6fc3cb1a46900ee8049c9fb30716..7688ff300bd08dc34896cbbc2c3d2818903125a2 100644
--- a/content/renderer/android/synchronous_compositor_impl.cc
+++ b/content/renderer/android/synchronous_compositor_impl.cc
@@ -12,7 +12,8 @@
namespace content {
SynchronousCompositorImpl::SynchronousCompositorImpl(int32 routing_id)
- : routing_id_(routing_id), compositor_client_(NULL) {}
+ : routing_id_(routing_id), compositor_client_(NULL) {
+}
SynchronousCompositorImpl::~SynchronousCompositorImpl() {
}
@@ -57,7 +58,6 @@ bool SynchronousCompositorImpl::DemandDrawHw(
void SynchronousCompositorImpl::SetContinuousInvalidate(bool enable) {
DCHECK(CalledOnValidThread());
- // compositor_client_ can be NULL during WebContents teardown.
if (compositor_client_)
compositor_client_->SetContinuousInvalidate(enable);
}
@@ -71,11 +71,24 @@ void SynchronousCompositorImpl::DidCreateSynchronousOutputSurface() {
void SynchronousCompositorImpl::DidDestroySynchronousOutputSurface() {
DCHECK(CalledOnValidThread());
output_surface_ = NULL;
- // compositor_client_ can be NULL during WebContents teardown.
if (compositor_client_)
compositor_client_->DidDestroyCompositor(this);
}
+void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) {
+ DCHECK(CalledOnValidThread());
+ if (compositor_client_)
+ compositor_client_->SetTotalRootLayerScrollOffset(new_value);
+}
+
+gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() {
+ DCHECK(CalledOnValidThread());
+ if (compositor_client_)
+ return compositor_client_->GetTotalRootLayerScrollOffset();
+ else
+ return gfx::Vector2dF();
mkosiba (inactive) 2013/05/29 13:18:24 this is the only downside of checking for composit
+}
+
// Not using base::NonThreadSafe as we want to enforce a more exacting threading
// requirement: SynchronousCompositorImpl() must only be used by
// embedders that supply their own compositor loop via
« no previous file with comments | « content/renderer/android/synchronous_compositor_impl.h ('k') | content/renderer/gpu/input_handler_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698