Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: cc/raster/tile_task_worker_pool_perftest.cc

Issue 1869753003: Replace many skia::RefPtr with sk_sp<> in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 capabilities.gpu.image = true; 81 capabilities.gpu.image = true;
82 capabilities.gpu.sync_query = true; 82 capabilities.gpu.sync_query = true;
83 return capabilities; 83 return capabilities;
84 } 84 }
85 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } 85 gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); }
86 gpu::ContextSupport* ContextSupport() override { return &support_; } 86 gpu::ContextSupport* ContextSupport() override { return &support_; }
87 class GrContext* GrContext() override { 87 class GrContext* GrContext() override {
88 if (gr_context_) 88 if (gr_context_)
89 return gr_context_.get(); 89 return gr_context_.get();
90 90
91 skia::RefPtr<const GrGLInterface> null_interface = 91 sk_sp<const GrGLInterface> null_interface(GrGLCreateNullInterface());
92 skia::AdoptRef(GrGLCreateNullInterface()); 92 gr_context_ = sk_sp<class GrContext>(GrContext::Create(
93 gr_context_ = skia::AdoptRef(GrContext::Create(
94 kOpenGL_GrBackend, 93 kOpenGL_GrBackend,
95 reinterpret_cast<GrBackendContext>(null_interface.get()))); 94 reinterpret_cast<GrBackendContext>(null_interface.get())));
96 return gr_context_.get(); 95 return gr_context_.get();
97 } 96 }
98 void InvalidateGrContext(uint32_t state) override { 97 void InvalidateGrContext(uint32_t state) override {
99 if (gr_context_) 98 if (gr_context_)
100 gr_context_.get()->resetContext(state); 99 gr_context_.get()->resetContext(state);
101 } 100 }
102 void SetupLock() override {} 101 void SetupLock() override {}
103 base::Lock* GetLock() override { return &context_lock_; } 102 base::Lock* GetLock() override { return &context_lock_; }
104 void DeleteCachedResources() override {} 103 void DeleteCachedResources() override {}
105 void SetLostContextCallback(const LostContextCallback& cb) override {} 104 void SetLostContextCallback(const LostContextCallback& cb) override {}
106 105
107 private: 106 private:
108 ~PerfContextProvider() override {} 107 ~PerfContextProvider() override {}
109 108
110 std::unique_ptr<PerfGLES2Interface> context_gl_; 109 scoped_ptr<PerfGLES2Interface> context_gl_;
danakj 2016/04/14 19:37:32 undo
tomhudson 2016/04/25 20:48:13 Done.
111 skia::RefPtr<class GrContext> gr_context_; 110 sk_sp<class GrContext> gr_context_;
112 TestContextSupport support_; 111 TestContextSupport support_;
113 base::Lock context_lock_; 112 base::Lock context_lock_;
114 }; 113 };
115 114
116 enum TileTaskWorkerPoolType { 115 enum TileTaskWorkerPoolType {
117 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, 116 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY,
118 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, 117 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY,
119 TILE_TASK_WORKER_POOL_TYPE_GPU, 118 TILE_TASK_WORKER_POOL_TYPE_GPU,
120 TILE_TASK_WORKER_POOL_TYPE_BITMAP 119 TILE_TASK_WORKER_POOL_TYPE_BITMAP
121 }; 120 };
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 RunBuildTileTaskGraphTest("1_0", 1, 0); 493 RunBuildTileTaskGraphTest("1_0", 1, 0);
495 RunBuildTileTaskGraphTest("32_0", 32, 0); 494 RunBuildTileTaskGraphTest("32_0", 32, 0);
496 RunBuildTileTaskGraphTest("1_1", 1, 1); 495 RunBuildTileTaskGraphTest("1_1", 1, 1);
497 RunBuildTileTaskGraphTest("32_1", 32, 1); 496 RunBuildTileTaskGraphTest("32_1", 32, 1);
498 RunBuildTileTaskGraphTest("1_4", 1, 4); 497 RunBuildTileTaskGraphTest("1_4", 1, 4);
499 RunBuildTileTaskGraphTest("32_4", 32, 4); 498 RunBuildTileTaskGraphTest("32_4", 32, 4);
500 } 499 }
501 500
502 } // namespace 501 } // namespace
503 } // namespace cc 502 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698