OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_factory_impl
.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" |
6 | 6 |
7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
8 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 8 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/renderer/gpu/frame_swap_message_queue.h" | 10 #include "content/renderer/gpu/frame_swap_message_queue.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create( | 48 scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create( |
49 NULL /* service */, | 49 NULL /* service */, |
50 NULL /* surface */, | 50 NULL /* surface */, |
51 true /* is_offscreen */, | 51 true /* is_offscreen */, |
52 gfx::kNullAcceleratedWidget, | 52 gfx::kNullAcceleratedWidget, |
53 gfx::Size(1, 1), | 53 gfx::Size(1, 1), |
54 NULL /* share_context */, | 54 NULL /* share_context */, |
55 false /* share_resources */, | 55 false /* share_resources */, |
56 in_process_attribs, | 56 in_process_attribs, |
57 gpu_preference, | 57 gpu_preference, |
58 gpu::GLInProcessContextSharedMemoryLimits())); | 58 gpu::GLInProcessContextSharedMemoryLimits(), |
| 59 nullptr, |
| 60 nullptr)); |
59 return context.Pass(); | 61 return context.Pass(); |
60 } | 62 } |
61 | 63 |
62 scoped_ptr<gpu::GLInProcessContext> CreateContext( | 64 scoped_ptr<gpu::GLInProcessContext> CreateContext( |
63 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, | 65 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, |
64 const gpu::GLInProcessContextSharedMemoryLimits& mem_limits) { | 66 const gpu::GLInProcessContextSharedMemoryLimits& mem_limits) { |
65 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 67 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
66 gpu::gles2::ContextCreationAttribHelper in_process_attribs; | 68 gpu::gles2::ContextCreationAttribHelper in_process_attribs; |
67 WebGraphicsContext3DImpl::ConvertAttributes( | 69 WebGraphicsContext3DImpl::ConvertAttributes( |
68 GetDefaultAttribs(), &in_process_attribs); | 70 GetDefaultAttribs(), &in_process_attribs); |
69 in_process_attribs.lose_context_when_out_of_memory = true; | 71 in_process_attribs.lose_context_when_out_of_memory = true; |
70 | 72 |
71 scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create( | 73 scoped_ptr<gpu::GLInProcessContext> context(gpu::GLInProcessContext::Create( |
72 service, | 74 service, |
73 NULL /* surface */, | 75 NULL /* surface */, |
74 false /* is_offscreen */, | 76 false /* is_offscreen */, |
75 gfx::kNullAcceleratedWidget, | 77 gfx::kNullAcceleratedWidget, |
76 gfx::Size(1, 1), | 78 gfx::Size(1, 1), |
77 NULL /* share_context */, | 79 NULL /* share_context */, |
78 false /* share_resources */, | 80 false /* share_resources */, |
79 in_process_attribs, | 81 in_process_attribs, |
80 gpu_preference, | 82 gpu_preference, |
81 mem_limits)); | 83 mem_limits, |
| 84 nullptr, |
| 85 nullptr)); |
82 return context.Pass(); | 86 return context.Pass(); |
83 } | 87 } |
84 | 88 |
85 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( | 89 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( |
86 scoped_ptr<gpu::GLInProcessContext> context) { | 90 scoped_ptr<gpu::GLInProcessContext> context) { |
87 if (!context.get()) | 91 if (!context.get()) |
88 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); | 92 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); |
89 | 93 |
90 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>( | 94 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>( |
91 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( | 95 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 DCHECK(!service_.get()); | 293 DCHECK(!service_.get()); |
290 service_ = service; | 294 service_ = service; |
291 } | 295 } |
292 | 296 |
293 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( | 297 void SynchronousCompositorFactoryImpl::SetRecordFullDocument( |
294 bool record_full_document) { | 298 bool record_full_document) { |
295 record_full_layer_ = record_full_document; | 299 record_full_layer_ = record_full_document; |
296 } | 300 } |
297 | 301 |
298 } // namespace content | 302 } // namespace content |
OLD | NEW |