| 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_output_surfa
ce.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 12 #include "cc/output/output_surface_client.h" | 12 #include "cc/output/output_surface_client.h" |
| 13 #include "cc/output/software_output_device.h" | 13 #include "cc/output/software_output_device.h" |
| 14 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 14 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "gpu/command_buffer/client/gl_in_process_context.h" | 16 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 17 #include "gpu/command_buffer/client/gles2_interface.h" |
| 17 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 18 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
| 18 #include "third_party/skia/include/core/SkBitmapDevice.h" | 19 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 19 #include "third_party/skia/include/core/SkCanvas.h" | 20 #include "third_party/skia/include/core/SkCanvas.h" |
| 20 #include "ui/gfx/rect_conversions.h" | 21 #include "ui/gfx/rect_conversions.h" |
| 21 #include "ui/gfx/skia_util.h" | 22 #include "ui/gfx/skia_util.h" |
| 22 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
| 23 #include "ui/gl/gl_surface.h" | 24 #include "ui/gl/gl_surface.h" |
| 24 #include "webkit/common/gpu/context_provider_in_process.h" | 25 #include "webkit/common/gpu/context_provider_in_process.h" |
| 25 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 26 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
| 26 | 27 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); | 168 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); |
| 168 if (delegate) | 169 if (delegate) |
| 169 delegate->SetContinuousInvalidate(needs_begin_impl_frame_); | 170 delegate->SetContinuousInvalidate(needs_begin_impl_frame_); |
| 170 } | 171 } |
| 171 | 172 |
| 172 void SynchronousCompositorOutputSurface::SwapBuffers( | 173 void SynchronousCompositorOutputSurface::SwapBuffers( |
| 173 cc::CompositorFrame* frame) { | 174 cc::CompositorFrame* frame) { |
| 174 DCHECK(CalledOnValidThread()); | 175 DCHECK(CalledOnValidThread()); |
| 175 if (!ForcedDrawToSoftwareDevice()) { | 176 if (!ForcedDrawToSoftwareDevice()) { |
| 176 DCHECK(context_provider_); | 177 DCHECK(context_provider_); |
| 177 context_provider_->Context3d()->shallowFlushCHROMIUM(); | 178 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
| 178 } | 179 } |
| 179 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); | 180 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); |
| 180 if (delegate) | 181 if (delegate) |
| 181 delegate->UpdateFrameMetaData(frame->metadata); | 182 delegate->UpdateFrameMetaData(frame->metadata); |
| 182 | 183 |
| 183 did_swap_buffer_ = true; | 184 did_swap_buffer_ = true; |
| 184 DidSwapBuffers(); | 185 DidSwapBuffers(); |
| 185 } | 186 } |
| 186 | 187 |
| 187 namespace { | 188 namespace { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 307 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 307 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 308 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 308 } | 309 } |
| 309 | 310 |
| 310 SynchronousCompositorOutputSurfaceDelegate* | 311 SynchronousCompositorOutputSurfaceDelegate* |
| 311 SynchronousCompositorOutputSurface::GetDelegate() { | 312 SynchronousCompositorOutputSurface::GetDelegate() { |
| 312 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 313 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
| 313 } | 314 } |
| 314 | 315 |
| 315 } // namespace content | 316 } // namespace content |
| OLD | NEW |