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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 capabilities.gpu.image = true; | 80 capabilities.gpu.image = true; |
81 capabilities.gpu.sync_query = true; | 81 capabilities.gpu.sync_query = true; |
82 return capabilities; | 82 return capabilities; |
83 } | 83 } |
84 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } | 84 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } |
85 gpu::ContextSupport* ContextSupport() override { return &support_; } | 85 gpu::ContextSupport* ContextSupport() override { return &support_; } |
86 class GrContext* GrContext() override { | 86 class GrContext* GrContext() override { |
87 if (gr_context_) | 87 if (gr_context_) |
88 return gr_context_.get(); | 88 return gr_context_.get(); |
89 | 89 |
90 skia::RefPtr<const GrGLInterface> null_interface = | 90 sk_sp<const GrGLInterface> null_interface(GrGLCreateNullInterface()); |
91 skia::AdoptRef(GrGLCreateNullInterface()); | 91 gr_context_ = sk_sp<class GrContext>(GrContext::Create( |
92 gr_context_ = skia::AdoptRef(GrContext::Create( | |
93 kOpenGL_GrBackend, | 92 kOpenGL_GrBackend, |
94 reinterpret_cast<GrBackendContext>(null_interface.get()))); | 93 reinterpret_cast<GrBackendContext>(null_interface.get()))); |
95 return gr_context_.get(); | 94 return gr_context_.get(); |
96 } | 95 } |
97 void InvalidateGrContext(uint32_t state) override { | 96 void InvalidateGrContext(uint32_t state) override { |
98 if (gr_context_) | 97 if (gr_context_) |
99 gr_context_.get()->resetContext(state); | 98 gr_context_.get()->resetContext(state); |
100 } | 99 } |
101 void SetupLock() override {} | 100 void SetupLock() override {} |
102 base::Lock* GetLock() override { return &context_lock_; } | 101 base::Lock* GetLock() override { return &context_lock_; } |
103 void DeleteCachedResources() override {} | 102 void DeleteCachedResources() override {} |
104 void SetLostContextCallback(const LostContextCallback& cb) override {} | 103 void SetLostContextCallback(const LostContextCallback& cb) override {} |
105 | 104 |
106 private: | 105 private: |
107 ~PerfContextProvider() override {} | 106 ~PerfContextProvider() override {} |
108 | 107 |
109 std::unique_ptr<PerfGLES2Interface> context_gl_; | 108 std::unique_ptr<PerfGLES2Interface> context_gl_; |
110 skia::RefPtr<class GrContext> gr_context_; | 109 sk_sp<class GrContext> gr_context_; |
111 TestContextSupport support_; | 110 TestContextSupport support_; |
112 base::Lock context_lock_; | 111 base::Lock context_lock_; |
113 }; | 112 }; |
114 | 113 |
115 enum TileTaskWorkerPoolType { | 114 enum TileTaskWorkerPoolType { |
116 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 115 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
117 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 116 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
118 TILE_TASK_WORKER_POOL_TYPE_GPU, | 117 TILE_TASK_WORKER_POOL_TYPE_GPU, |
119 TILE_TASK_WORKER_POOL_TYPE_BITMAP | 118 TILE_TASK_WORKER_POOL_TYPE_BITMAP |
120 }; | 119 }; |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 RunBuildTileTaskGraphTest("1_0", 1, 0); | 494 RunBuildTileTaskGraphTest("1_0", 1, 0); |
496 RunBuildTileTaskGraphTest("32_0", 32, 0); | 495 RunBuildTileTaskGraphTest("32_0", 32, 0); |
497 RunBuildTileTaskGraphTest("1_1", 1, 1); | 496 RunBuildTileTaskGraphTest("1_1", 1, 1); |
498 RunBuildTileTaskGraphTest("32_1", 32, 1); | 497 RunBuildTileTaskGraphTest("32_1", 32, 1); |
499 RunBuildTileTaskGraphTest("1_4", 1, 4); | 498 RunBuildTileTaskGraphTest("1_4", 1, 4); |
500 RunBuildTileTaskGraphTest("32_4", 32, 4); | 499 RunBuildTileTaskGraphTest("32_4", 32, 4); |
501 } | 500 } |
502 | 501 |
503 } // namespace | 502 } // namespace |
504 } // namespace cc | 503 } // namespace cc |
OLD | NEW |