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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 void SynchronousCompositorImpl::UpdateFrameMetaData( | 157 void SynchronousCompositorImpl::UpdateFrameMetaData( |
158 const cc::CompositorFrameMetadata& frame_metadata) { | 158 const cc::CompositorFrameMetadata& frame_metadata) { |
159 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 159 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
160 contents_->GetRenderWidgetHostView()); | 160 contents_->GetRenderWidgetHostView()); |
161 if (rwhv) | 161 if (rwhv) |
162 rwhv->SynchronousFrameMetadata(frame_metadata); | 162 rwhv->SynchronousFrameMetadata(frame_metadata); |
163 DeliverMessages(); | 163 DeliverMessages(); |
164 } | 164 } |
165 | 165 |
166 void SynchronousCompositorImpl::SetMemoryPolicy( | 166 void SynchronousCompositorImpl::SetMemoryPolicy(size_t bytes_limit) { |
167 const SynchronousCompositorMemoryPolicy& policy) { | |
168 DCHECK(CalledOnValidThread()); | 167 DCHECK(CalledOnValidThread()); |
169 DCHECK(output_surface_); | 168 DCHECK(output_surface_); |
170 | 169 |
171 output_surface_->SetMemoryPolicy(policy); | 170 output_surface_->SetMemoryPolicy(bytes_limit); |
172 } | 171 } |
173 | 172 |
174 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() { | 173 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() { |
175 if (input_handler_) | 174 if (input_handler_) |
176 input_handler_->OnRootLayerDelegatedScrollOffsetChanged(); | 175 input_handler_->OnRootLayerDelegatedScrollOffsetChanged(); |
177 } | 176 } |
178 | 177 |
179 void SynchronousCompositorImpl::DidBindOutputSurface( | 178 void SynchronousCompositorImpl::DidBindOutputSurface( |
180 SynchronousCompositorOutputSurface* output_surface) { | 179 SynchronousCompositorOutputSurface* output_surface) { |
181 DCHECK(CalledOnValidThread()); | 180 DCHECK(CalledOnValidThread()); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 g_factory.Get(); // Ensure it's initialized. | 309 g_factory.Get(); // Ensure it's initialized. |
311 SynchronousCompositorImpl::CreateForWebContents(contents); | 310 SynchronousCompositorImpl::CreateForWebContents(contents); |
312 } | 311 } |
313 if (SynchronousCompositorImpl* instance = | 312 if (SynchronousCompositorImpl* instance = |
314 SynchronousCompositorImpl::FromWebContents(contents)) { | 313 SynchronousCompositorImpl::FromWebContents(contents)) { |
315 instance->SetClient(client); | 314 instance->SetClient(client); |
316 } | 315 } |
317 } | 316 } |
318 | 317 |
319 } // namespace content | 318 } // namespace content |
OLD | NEW |