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 18 matching lines...) Expand all Loading... |
29 namespace { | 29 namespace { |
30 | 30 |
31 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> | 31 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> |
32 CreateWebGraphicsContext3D(scoped_refptr<gfx::GLSurface> surface) { | 32 CreateWebGraphicsContext3D(scoped_refptr<gfx::GLSurface> surface) { |
33 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 33 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
34 if (!gfx::GLSurface::InitializeOneOff()) | 34 if (!gfx::GLSurface::InitializeOneOff()) |
35 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); | 35 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); |
36 | 36 |
37 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 37 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
38 | 38 |
39 WebKit::WebGraphicsContext3D::Attributes attributes; | 39 blink::WebGraphicsContext3D::Attributes attributes; |
40 attributes.antialias = false; | 40 attributes.antialias = false; |
41 attributes.shareResources = true; | 41 attributes.shareResources = true; |
42 attributes.noAutomaticFlushes = true; | 42 attributes.noAutomaticFlushes = true; |
43 | 43 |
44 gpu::GLInProcessContextAttribs in_process_attribs; | 44 gpu::GLInProcessContextAttribs in_process_attribs; |
45 WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( | 45 WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( |
46 attributes, &in_process_attribs); | 46 attributes, &in_process_attribs); |
47 scoped_ptr<gpu::GLInProcessContext> context( | 47 scoped_ptr<gpu::GLInProcessContext> context( |
48 gpu::GLInProcessContext::CreateWithSurface(surface, | 48 gpu::GLInProcessContext::CreateWithSurface(surface, |
49 attributes.shareResources, | 49 attributes.shareResources, |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 306 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
307 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 307 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
308 } | 308 } |
309 | 309 |
310 SynchronousCompositorOutputSurfaceDelegate* | 310 SynchronousCompositorOutputSurfaceDelegate* |
311 SynchronousCompositorOutputSurface::GetDelegate() { | 311 SynchronousCompositorOutputSurface::GetDelegate() { |
312 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 312 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
313 } | 313 } |
314 | 314 |
315 } // namespace content | 315 } // namespace content |
OLD | NEW |