| 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" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 bool SynchronousCompositorOutputSurface::InitializeHwDraw( | 196 bool SynchronousCompositorOutputSurface::InitializeHwDraw( |
| 197 scoped_refptr<gfx::GLSurface> surface, | 197 scoped_refptr<gfx::GLSurface> surface, |
| 198 scoped_refptr<cc::ContextProvider> offscreen_context_provider) { | 198 scoped_refptr<cc::ContextProvider> offscreen_context_provider) { |
| 199 DCHECK(CalledOnValidThread()); | 199 DCHECK(CalledOnValidThread()); |
| 200 DCHECK(HasClient()); | 200 DCHECK(HasClient()); |
| 201 DCHECK(!context_provider_); | 201 DCHECK(!context_provider_); |
| 202 DCHECK(surface); | 202 DCHECK(surface); |
| 203 | 203 |
| 204 scoped_refptr<cc::ContextProvider> onscreen_context_provider = | 204 scoped_refptr<cc::ContextProvider> onscreen_context_provider = |
| 205 webkit::gpu::ContextProviderInProcess::Create( | 205 webkit::gpu::ContextProviderInProcess::Create( |
| 206 base::Bind(&CreateWebGraphicsContext3D, surface)); | 206 CreateWebGraphicsContext3D(surface)); |
| 207 return InitializeAndSetContext3d(onscreen_context_provider, | 207 return InitializeAndSetContext3d(onscreen_context_provider, |
| 208 offscreen_context_provider); | 208 offscreen_context_provider); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void SynchronousCompositorOutputSurface::ReleaseHwDraw() { | 211 void SynchronousCompositorOutputSurface::ReleaseHwDraw() { |
| 212 cc::OutputSurface::ReleaseGL(); | 212 cc::OutputSurface::ReleaseGL(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool SynchronousCompositorOutputSurface::DemandDrawHw( | 215 bool SynchronousCompositorOutputSurface::DemandDrawHw( |
| 216 gfx::Size surface_size, | 216 gfx::Size surface_size, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 279 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 280 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 280 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 281 } | 281 } |
| 282 | 282 |
| 283 SynchronousCompositorOutputSurfaceDelegate* | 283 SynchronousCompositorOutputSurfaceDelegate* |
| 284 SynchronousCompositorOutputSurface::GetDelegate() { | 284 SynchronousCompositorOutputSurface::GetDelegate() { |
| 285 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 285 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace content | 288 } // namespace content |
| OLD | NEW |