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

Side by Side Diff: bench/GrResourceCacheBench.cpp

Issue 846303002: Make uncached textures uncached from the get go. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years, 11 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
« no previous file with comments | « no previous file | include/gpu/GrGpuResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "Benchmark.h" 9 #include "Benchmark.h"
10 10
11 #if SK_SUPPORT_GPU 11 #if SK_SUPPORT_GPU
12 12
13 #include "GrGpuResource.h" 13 #include "GrGpuResource.h"
14 #include "GrContext.h" 14 #include "GrContext.h"
15 #include "GrGpu.h" 15 #include "GrGpu.h"
16 #include "GrResourceCache2.h" 16 #include "GrResourceCache2.h"
17 #include "SkCanvas.h" 17 #include "SkCanvas.h"
18 18
19 enum { 19 enum {
20 CACHE_SIZE_COUNT = 4096, 20 CACHE_SIZE_COUNT = 4096,
21 }; 21 };
22 22
23 class BenchResource : public GrGpuResource { 23 class BenchResource : public GrGpuResource {
24 public: 24 public:
25 SK_DECLARE_INST_COUNT(BenchResource); 25 SK_DECLARE_INST_COUNT(BenchResource);
26 BenchResource (GrGpu* gpu) 26 BenchResource (GrGpu* gpu)
27 : INHERITED(gpu, false) { 27 : INHERITED(gpu, kCached_LifeCycle) {
28 this->registerWithCache(); 28 this->registerWithCache();
29 } 29 }
30 30
31 static GrResourceKey ComputeKey(int i) { 31 static GrResourceKey ComputeKey(int i) {
32 GrCacheID::Key key; 32 GrCacheID::Key key;
33 memset(&key, 0, sizeof(key)); 33 memset(&key, 0, sizeof(key));
34 key.fData32[0] = i; 34 key.fData32[0] = i;
35 static int gDomain = GrCacheID::GenerateDomain(); 35 static int gDomain = GrCacheID::GenerateDomain();
36 return GrResourceKey(GrCacheID(gDomain, key), 0); 36 return GrResourceKey(GrCacheID(gDomain, key), 0);
37 } 37 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 private: 137 private:
138 SkAutoTUnref<GrContext> fContext; 138 SkAutoTUnref<GrContext> fContext;
139 typedef Benchmark INHERITED; 139 typedef Benchmark INHERITED;
140 }; 140 };
141 141
142 DEF_BENCH( return new GrResourceCacheBenchAdd(); ) 142 DEF_BENCH( return new GrResourceCacheBenchAdd(); )
143 DEF_BENCH( return new GrResourceCacheBenchFind(); ) 143 DEF_BENCH( return new GrResourceCacheBenchFind(); )
144 144
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrGpuResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698