Chromium Code Reviews| 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 |