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

Side by Side 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: rebase on top of crrev.com/15875009 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/android/synchronous_compositor_impl.h" 5 #include "content/renderer/android/synchronous_compositor_impl.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "cc/input/input_handler.h" 8 #include "cc/input/input_handler.h"
9 #include "content/public/renderer/android/synchronous_compositor_client.h" 9 #include "content/public/renderer/android/synchronous_compositor_client.h"
10 #include "content/public/renderer/content_renderer_client.h" 10 #include "content/public/renderer/content_renderer_client.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GetContentClient()->renderer()->DidCreateSynchronousCompositor(routing_id_, 65 GetContentClient()->renderer()->DidCreateSynchronousCompositor(routing_id_,
66 this); 66 this);
67 } 67 }
68 68
69 void SynchronousCompositorImpl::DidDestroySynchronousOutputSurface() { 69 void SynchronousCompositorImpl::DidDestroySynchronousOutputSurface() {
70 DCHECK(CalledOnValidThread()); 70 DCHECK(CalledOnValidThread());
71 output_surface_ = NULL; 71 output_surface_ = NULL;
72 compositor_client_->DidDestroyCompositor(this); 72 compositor_client_->DidDestroyCompositor(this);
73 } 73 }
74 74
75 void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) {
76 DCHECK(CalledOnValidThread());
77 compositor_client_->SetTotalRootLayerScrollOffset(new_value);
mkosiba (inactive) 2013/05/28 17:29:50 actually it looks like this ends up causing a use-
joth 2013/05/28 17:36:25 Hmm.. I think the bug is in your prior refactor pa
mkosiba (inactive) 2013/05/29 13:18:24 ah, I see. Yes, I can do that. Do you know if the
78 }
79
80 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() {
81 DCHECK(CalledOnValidThread());
82 return compositor_client_->GetTotalRootLayerScrollOffset();
83 }
84
75 // Not using base::NonThreadSafe as we want to enforce a more exacting threading 85 // Not using base::NonThreadSafe as we want to enforce a more exacting threading
76 // requirement: SynchronousCompositorImpl() must only be used by 86 // requirement: SynchronousCompositorImpl() must only be used by
77 // embedders that supply their own compositor loop via 87 // embedders that supply their own compositor loop via
78 // OverrideCompositorMessageLoop(). 88 // OverrideCompositorMessageLoop().
79 bool SynchronousCompositorImpl::CalledOnValidThread() const { 89 bool SynchronousCompositorImpl::CalledOnValidThread() const {
80 return base::MessageLoop::current() && (base::MessageLoop::current() == 90 return base::MessageLoop::current() && (base::MessageLoop::current() ==
81 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); 91 GetContentClient()->renderer()->OverrideCompositorMessageLoop());
82 } 92 }
83 93
84 } // namespace content 94 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698