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/raster/tile_task_worker_pool.h" | 5 #include "cc/raster/tile_task_worker_pool.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "cc/resources/resource_pool.h" | 23 #include "cc/resources/resource_pool.h" |
24 #include "cc/resources/resource_provider.h" | 24 #include "cc/resources/resource_provider.h" |
25 #include "cc/resources/scoped_resource.h" | 25 #include "cc/resources/scoped_resource.h" |
26 #include "cc/test/fake_output_surface.h" | 26 #include "cc/test/fake_output_surface.h" |
27 #include "cc/test/fake_output_surface_client.h" | 27 #include "cc/test/fake_output_surface_client.h" |
28 #include "cc/test/fake_resource_provider.h" | 28 #include "cc/test/fake_resource_provider.h" |
29 #include "cc/test/test_context_support.h" | 29 #include "cc/test/test_context_support.h" |
30 #include "cc/test/test_gpu_memory_buffer_manager.h" | 30 #include "cc/test/test_gpu_memory_buffer_manager.h" |
31 #include "cc/test/test_shared_bitmap_manager.h" | 31 #include "cc/test/test_shared_bitmap_manager.h" |
32 #include "cc/test/test_web_graphics_context_3d.h" | 32 #include "cc/test/test_web_graphics_context_3d.h" |
| 33 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
34 #include "testing/perf/perf_test.h" | 35 #include "testing/perf/perf_test.h" |
35 #include "third_party/khronos/GLES2/gl2.h" | 36 #include "third_party/khronos/GLES2/gl2.h" |
36 #include "third_party/skia/include/gpu/GrContext.h" | 37 #include "third_party/skia/include/gpu/GrContext.h" |
37 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 38 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
38 | 39 |
39 namespace cc { | 40 namespace cc { |
40 namespace { | 41 namespace { |
41 | 42 |
42 class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub { | 43 class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 capabilities.gpu.image = true; | 82 capabilities.gpu.image = true; |
82 capabilities.gpu.sync_query = true; | 83 capabilities.gpu.sync_query = true; |
83 return capabilities; | 84 return capabilities; |
84 } | 85 } |
85 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } | 86 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } |
86 gpu::ContextSupport* ContextSupport() override { return &support_; } | 87 gpu::ContextSupport* ContextSupport() override { return &support_; } |
87 class GrContext* GrContext() override { | 88 class GrContext* GrContext() override { |
88 if (gr_context_) | 89 if (gr_context_) |
89 return gr_context_.get(); | 90 return gr_context_.get(); |
90 | 91 |
91 skia::RefPtr<const GrGLInterface> null_interface = | 92 skia::RefPtr<GrGLInterface> gl_interface = |
92 skia::AdoptRef(GrGLCreateNullInterface()); | 93 skia::AdoptRef(new GrGLInterface); |
| 94 skia_bindings::InitGLES2InterfaceBindings(gl_interface.get(), |
| 95 context_gl_.get()); |
93 gr_context_ = skia::AdoptRef(GrContext::Create( | 96 gr_context_ = skia::AdoptRef(GrContext::Create( |
94 kOpenGL_GrBackend, | 97 kOpenGL_GrBackend, |
95 reinterpret_cast<GrBackendContext>(null_interface.get()))); | 98 reinterpret_cast<GrBackendContext>(gl_interface.get()))); |
96 return gr_context_.get(); | 99 return gr_context_.get(); |
97 } | 100 } |
98 void InvalidateGrContext(uint32_t state) override { | 101 void InvalidateGrContext(uint32_t state) override { |
99 if (gr_context_) | 102 if (gr_context_) |
100 gr_context_.get()->resetContext(state); | 103 gr_context_.get()->resetContext(state); |
101 } | 104 } |
102 void SetupLock() override {} | 105 void SetupLock() override {} |
103 base::Lock* GetLock() override { return &context_lock_; } | 106 base::Lock* GetLock() override { return &context_lock_; } |
104 void DeleteCachedResources() override {} | 107 void DeleteCachedResources() override {} |
105 void SetLostContextCallback(const LostContextCallback& cb) override {} | 108 void SetLostContextCallback(const LostContextCallback& cb) override {} |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 RunBuildTileTaskGraphTest("1_0", 1, 0); | 497 RunBuildTileTaskGraphTest("1_0", 1, 0); |
495 RunBuildTileTaskGraphTest("32_0", 32, 0); | 498 RunBuildTileTaskGraphTest("32_0", 32, 0); |
496 RunBuildTileTaskGraphTest("1_1", 1, 1); | 499 RunBuildTileTaskGraphTest("1_1", 1, 1); |
497 RunBuildTileTaskGraphTest("32_1", 32, 1); | 500 RunBuildTileTaskGraphTest("32_1", 32, 1); |
498 RunBuildTileTaskGraphTest("1_4", 1, 4); | 501 RunBuildTileTaskGraphTest("1_4", 1, 4); |
499 RunBuildTileTaskGraphTest("32_4", 32, 4); | 502 RunBuildTileTaskGraphTest("32_4", 32, 4); |
500 } | 503 } |
501 | 504 |
502 } // namespace | 505 } // namespace |
503 } // namespace cc | 506 } // namespace cc |
OLD | NEW |