| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 capabilities.image = true; | 79 capabilities.image = true; |
| 80 capabilities.sync_query = true; | 80 capabilities.sync_query = true; |
| 81 return capabilities; | 81 return capabilities; |
| 82 } | 82 } |
| 83 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } | 83 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } |
| 84 gpu::ContextSupport* ContextSupport() override { return &support_; } | 84 gpu::ContextSupport* ContextSupport() override { return &support_; } |
| 85 class GrContext* GrContext() override { | 85 class GrContext* GrContext() override { |
| 86 if (gr_context_) | 86 if (gr_context_) |
| 87 return gr_context_.get(); | 87 return gr_context_.get(); |
| 88 | 88 |
| 89 skia::RefPtr<const GrGLInterface> null_interface = | 89 sk_sp<const GrGLInterface> null_interface(GrGLCreateNullInterface()); |
| 90 skia::AdoptRef(GrGLCreateNullInterface()); | 90 gr_context_ = sk_sp<class GrContext>(GrContext::Create( |
| 91 gr_context_ = skia::AdoptRef(GrContext::Create( | |
| 92 kOpenGL_GrBackend, | 91 kOpenGL_GrBackend, |
| 93 reinterpret_cast<GrBackendContext>(null_interface.get()))); | 92 reinterpret_cast<GrBackendContext>(null_interface.get()))); |
| 94 return gr_context_.get(); | 93 return gr_context_.get(); |
| 95 } | 94 } |
| 96 void InvalidateGrContext(uint32_t state) override { | 95 void InvalidateGrContext(uint32_t state) override { |
| 97 if (gr_context_) | 96 if (gr_context_) |
| 98 gr_context_.get()->resetContext(state); | 97 gr_context_.get()->resetContext(state); |
| 99 } | 98 } |
| 100 void SetupLock() override {} | 99 void SetupLock() override {} |
| 101 base::Lock* GetLock() override { return &context_lock_; } | 100 base::Lock* GetLock() override { return &context_lock_; } |
| 102 void DeleteCachedResources() override {} | 101 void DeleteCachedResources() override {} |
| 103 void SetLostContextCallback(const LostContextCallback& cb) override {} | 102 void SetLostContextCallback(const LostContextCallback& cb) override {} |
| 104 | 103 |
| 105 private: | 104 private: |
| 106 ~PerfContextProvider() override {} | 105 ~PerfContextProvider() override {} |
| 107 | 106 |
| 108 std::unique_ptr<PerfGLES2Interface> context_gl_; | 107 std::unique_ptr<PerfGLES2Interface> context_gl_; |
| 109 skia::RefPtr<class GrContext> gr_context_; | 108 sk_sp<class GrContext> gr_context_; |
| 110 TestContextSupport support_; | 109 TestContextSupport support_; |
| 111 base::Lock context_lock_; | 110 base::Lock context_lock_; |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 enum TileTaskWorkerPoolType { | 113 enum TileTaskWorkerPoolType { |
| 115 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 114 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
| 116 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 115 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
| 117 TILE_TASK_WORKER_POOL_TYPE_GPU, | 116 TILE_TASK_WORKER_POOL_TYPE_GPU, |
| 118 TILE_TASK_WORKER_POOL_TYPE_BITMAP | 117 TILE_TASK_WORKER_POOL_TYPE_BITMAP |
| 119 }; | 118 }; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 RunBuildTileTaskGraphTest("1_0", 1, 0); | 486 RunBuildTileTaskGraphTest("1_0", 1, 0); |
| 488 RunBuildTileTaskGraphTest("32_0", 32, 0); | 487 RunBuildTileTaskGraphTest("32_0", 32, 0); |
| 489 RunBuildTileTaskGraphTest("1_1", 1, 1); | 488 RunBuildTileTaskGraphTest("1_1", 1, 1); |
| 490 RunBuildTileTaskGraphTest("32_1", 32, 1); | 489 RunBuildTileTaskGraphTest("32_1", 32, 1); |
| 491 RunBuildTileTaskGraphTest("1_4", 1, 4); | 490 RunBuildTileTaskGraphTest("1_4", 1, 4); |
| 492 RunBuildTileTaskGraphTest("32_4", 32, 4); | 491 RunBuildTileTaskGraphTest("32_4", 32, 4); |
| 493 } | 492 } |
| 494 | 493 |
| 495 } // namespace | 494 } // namespace |
| 496 } // namespace cc | 495 } // namespace cc |
| OLD | NEW |