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 "cc/test/test_in_process_context_provider.h" | 5 #include "cc/test/test_in_process_context_provider.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "cc/resources/platform_color.h" | 12 #include "cc/resources/platform_color.h" |
13 #include "gpu/GLES2/gl2extchromium.h" | 13 #include "gpu/GLES2/gl2extchromium.h" |
14 #include "gpu/command_buffer/client/gl_in_process_context.h" | 14 #include "gpu/command_buffer/client/gl_in_process_context.h" |
15 #include "gpu/command_buffer/client/gles2_implementation.h" | 15 #include "gpu/command_buffer/client/gles2_implementation.h" |
16 #include "gpu/command_buffer/client/gles2_lib.h" | 16 #include "gpu/command_buffer/client/gles2_lib.h" |
| 17 #include "gpu/command_buffer/client/shared_memory_limits.h" |
17 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 18 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
18 #include "gpu/skia_bindings/grcontext_for_gles2_interface.h" | 19 #include "gpu/skia_bindings/grcontext_for_gles2_interface.h" |
19 #include "third_party/khronos/GLES2/gl2.h" | 20 #include "third_party/khronos/GLES2/gl2.h" |
20 #include "third_party/khronos/GLES2/gl2ext.h" | 21 #include "third_party/khronos/GLES2/gl2ext.h" |
21 #include "third_party/skia/include/gpu/GrContext.h" | 22 #include "third_party/skia/include/gpu/GrContext.h" |
22 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 23 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
24 | 25 |
25 namespace cc { | 26 namespace cc { |
26 | 27 |
(...skipping 13 matching lines...) Expand all Loading... |
40 attribs.samples = 0; | 41 attribs.samples = 0; |
41 attribs.sample_buffers = 0; | 42 attribs.sample_buffers = 0; |
42 attribs.fail_if_major_perf_caveat = false; | 43 attribs.fail_if_major_perf_caveat = false; |
43 attribs.bind_generates_resource = false; | 44 attribs.bind_generates_resource = false; |
44 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 45 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
45 | 46 |
46 std::unique_ptr<gpu::GLInProcessContext> context = | 47 std::unique_ptr<gpu::GLInProcessContext> context = |
47 base::WrapUnique(gpu::GLInProcessContext::Create( | 48 base::WrapUnique(gpu::GLInProcessContext::Create( |
48 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget, | 49 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget, |
49 gfx::Size(1, 1), shared_context, attribs, gpu_preference, | 50 gfx::Size(1, 1), shared_context, attribs, gpu_preference, |
50 gpu::GLInProcessContextSharedMemoryLimits(), | 51 gpu::SharedMemoryLimits(), gpu_memory_buffer_manager, image_factory)); |
51 gpu_memory_buffer_manager, image_factory)); | |
52 | 52 |
53 DCHECK(context); | 53 DCHECK(context); |
54 return context; | 54 return context; |
55 } | 55 } |
56 | 56 |
57 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() { | 57 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() { |
58 return CreateTestInProcessContext(nullptr, nullptr, nullptr); | 58 return CreateTestInProcessContext(nullptr, nullptr, nullptr); |
59 } | 59 } |
60 | 60 |
61 TestInProcessContextProvider::TestInProcessContextProvider( | 61 TestInProcessContextProvider::TestInProcessContextProvider( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 void TestInProcessContextProvider::DeleteCachedResources() { | 119 void TestInProcessContextProvider::DeleteCachedResources() { |
120 if (gr_context_) | 120 if (gr_context_) |
121 gr_context_->FreeGpuResources(); | 121 gr_context_->FreeGpuResources(); |
122 } | 122 } |
123 | 123 |
124 void TestInProcessContextProvider::SetLostContextCallback( | 124 void TestInProcessContextProvider::SetLostContextCallback( |
125 const LostContextCallback& lost_context_callback) {} | 125 const LostContextCallback& lost_context_callback) {} |
126 | 126 |
127 } // namespace cc | 127 } // namespace cc |
OLD | NEW |