| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 gpu::GLInProcessContext* SynchronousCompositorImpl::GetShareContext() { | 118 gpu::GLInProcessContext* SynchronousCompositorImpl::GetShareContext() { |
| 119 DCHECK(CalledOnValidThread()); | 119 DCHECK(CalledOnValidThread()); |
| 120 return g_factory.Get().GetShareContext(); | 120 return g_factory.Get().GetShareContext(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 scoped_ptr<cc::CompositorFrame> SynchronousCompositorImpl::DemandDrawHw( | 123 scoped_ptr<cc::CompositorFrame> SynchronousCompositorImpl::DemandDrawHw( |
| 124 gfx::Size surface_size, | 124 gfx::Size surface_size, |
| 125 const gfx::Transform& transform, | 125 const gfx::Transform& transform, |
| 126 gfx::Rect viewport, | 126 gfx::Rect viewport, |
| 127 gfx::Rect clip) { | 127 gfx::Rect clip, |
| 128 gfx::Rect device_rect_for_tiling) { |
| 128 DCHECK(CalledOnValidThread()); | 129 DCHECK(CalledOnValidThread()); |
| 129 DCHECK(output_surface_); | 130 DCHECK(output_surface_); |
| 130 | 131 |
| 131 scoped_ptr<cc::CompositorFrame> frame = | 132 scoped_ptr<cc::CompositorFrame> frame = output_surface_->DemandDrawHw( |
| 132 output_surface_->DemandDrawHw(surface_size, transform, viewport, clip); | 133 surface_size, transform, viewport, clip, device_rect_for_tiling); |
| 133 if (frame.get()) | 134 if (frame.get()) |
| 134 UpdateFrameMetaData(frame->metadata); | 135 UpdateFrameMetaData(frame->metadata); |
| 135 return frame.Pass(); | 136 return frame.Pass(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void SynchronousCompositorImpl::ReturnResources( | 139 void SynchronousCompositorImpl::ReturnResources( |
| 139 const cc::CompositorFrameAck& frame_ack) { | 140 const cc::CompositorFrameAck& frame_ack) { |
| 140 DCHECK(CalledOnValidThread()); | 141 DCHECK(CalledOnValidThread()); |
| 141 output_surface_->ReturnResources(frame_ack); | 142 output_surface_->ReturnResources(frame_ack); |
| 142 } | 143 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 g_factory.Get(); // Ensure it's initialized. | 290 g_factory.Get(); // Ensure it's initialized. |
| 290 SynchronousCompositorImpl::CreateForWebContents(contents); | 291 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 291 } | 292 } |
| 292 if (SynchronousCompositorImpl* instance = | 293 if (SynchronousCompositorImpl* instance = |
| 293 SynchronousCompositorImpl::FromWebContents(contents)) { | 294 SynchronousCompositorImpl::FromWebContents(contents)) { |
| 294 instance->SetClient(client); | 295 instance->SetClient(client); |
| 295 } | 296 } |
| 296 } | 297 } |
| 297 | 298 |
| 298 } // namespace content | 299 } // namespace content |
| OLD | NEW |