| OLD | NEW |
| 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/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "cc/input/input_handler.h" | 9 #include "cc/input/input_handler.h" |
| 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" | 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 | 209 |
| 210 void SynchronousCompositorImpl::UpdateFrameMetaData( | 210 void SynchronousCompositorImpl::UpdateFrameMetaData( |
| 211 const cc::CompositorFrameMetadata& frame_metadata) { | 211 const cc::CompositorFrameMetadata& frame_metadata) { |
| 212 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 212 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 213 contents_->GetRenderWidgetHostView()); | 213 contents_->GetRenderWidgetHostView()); |
| 214 if (rwhv) | 214 if (rwhv) |
| 215 rwhv->SynchronousFrameMetadata(frame_metadata); | 215 rwhv->SynchronousFrameMetadata(frame_metadata); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void SynchronousCompositorImpl::DeliverMessages( |
| 219 const std::vector<IPC::Message>& messages) { |
| 220 RenderProcessHost* rph = contents_->GetRenderProcessHost(); |
| 221 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
| 222 i != messages.end(); |
| 223 ++i) { |
| 224 rph->OnMessageReceived(*i); |
| 225 } |
| 226 } |
| 227 |
| 218 void SynchronousCompositorImpl::DidActivatePendingTree() { | 228 void SynchronousCompositorImpl::DidActivatePendingTree() { |
| 219 if (compositor_client_) | 229 if (compositor_client_) |
| 220 compositor_client_->DidUpdateContent(); | 230 compositor_client_->DidUpdateContent(); |
| 221 } | 231 } |
| 222 | 232 |
| 223 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { | 233 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { |
| 224 DCHECK(CalledOnValidThread()); | 234 DCHECK(CalledOnValidThread()); |
| 225 if (compositor_client_) | 235 if (compositor_client_) |
| 226 return compositor_client_->GetTotalRootLayerScrollOffset(); | 236 return compositor_client_->GetTotalRootLayerScrollOffset(); |
| 227 return gfx::Vector2dF(); | 237 return gfx::Vector2dF(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 g_factory.Get(); // Ensure it's initialized. | 278 g_factory.Get(); // Ensure it's initialized. |
| 269 SynchronousCompositorImpl::CreateForWebContents(contents); | 279 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 270 } | 280 } |
| 271 if (SynchronousCompositorImpl* instance = | 281 if (SynchronousCompositorImpl* instance = |
| 272 SynchronousCompositorImpl::FromWebContents(contents)) { | 282 SynchronousCompositorImpl::FromWebContents(contents)) { |
| 273 instance->SetClient(client); | 283 instance->SetClient(client); |
| 274 } | 284 } |
| 275 } | 285 } |
| 276 | 286 |
| 277 } // namespace content | 287 } // namespace content |
| OLD | NEW |