| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 scoped_refptr<gfx::GLSurface> surface, | 195 scoped_refptr<gfx::GLSurface> surface, |
| 196 scoped_refptr<cc::ContextProvider> offscreen_context_provider) { | 196 scoped_refptr<cc::ContextProvider> offscreen_context_provider) { |
| 197 DCHECK(CalledOnValidThread()); | 197 DCHECK(CalledOnValidThread()); |
| 198 DCHECK(HasClient()); | 198 DCHECK(HasClient()); |
| 199 DCHECK(!context_provider_); | 199 DCHECK(!context_provider_); |
| 200 DCHECK(surface); | 200 DCHECK(surface); |
| 201 | 201 |
| 202 scoped_refptr<cc::ContextProvider> onscreen_context_provider = | 202 scoped_refptr<cc::ContextProvider> onscreen_context_provider = |
| 203 webkit::gpu::ContextProviderInProcess::Create( | 203 webkit::gpu::ContextProviderInProcess::Create( |
| 204 CreateWebGraphicsContext3D(surface), "SynchronousCompositor"); | 204 CreateWebGraphicsContext3D(surface), "SynchronousCompositor"); |
| 205 if (!onscreen_context_provider) |
| 206 return false; |
| 205 return InitializeAndSetContext3d(onscreen_context_provider, | 207 return InitializeAndSetContext3d(onscreen_context_provider, |
| 206 offscreen_context_provider); | 208 offscreen_context_provider); |
| 207 } | 209 } |
| 208 | 210 |
| 209 void SynchronousCompositorOutputSurface::ReleaseHwDraw() { | 211 void SynchronousCompositorOutputSurface::ReleaseHwDraw() { |
| 210 DCHECK(CalledOnValidThread()); | 212 DCHECK(CalledOnValidThread()); |
| 211 cc::OutputSurface::ReleaseGL(); | 213 cc::OutputSurface::ReleaseGL(); |
| 212 } | 214 } |
| 213 | 215 |
| 214 bool SynchronousCompositorOutputSurface::DemandDrawHw( | 216 bool SynchronousCompositorOutputSurface::DemandDrawHw( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 308 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 307 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 309 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 308 } | 310 } |
| 309 | 311 |
| 310 SynchronousCompositorOutputSurfaceDelegate* | 312 SynchronousCompositorOutputSurfaceDelegate* |
| 311 SynchronousCompositorOutputSurface::GetDelegate() { | 313 SynchronousCompositorOutputSurface::GetDelegate() { |
| 312 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 314 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
| 313 } | 315 } |
| 314 | 316 |
| 315 } // namespace content | 317 } // namespace content |
| OLD | NEW |