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

Side by Side Diff: bench/GrResourceCacheBench.cpp

Issue 618733002: Revert of Make "priv" classes for GrTexure and GrSurface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | gyp/gpu.gypi » ('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 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
11 #include "Benchmark.h" 11 #include "Benchmark.h"
12 #include "GrGpuResource.h" 12 #include "GrGpuResource.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrResourceCache.h" 14 #include "GrResourceCache.h"
15 #include "GrStencilBuffer.h" 15 #include "GrStencilBuffer.h"
16 #include "GrTexture.h" 16 #include "GrTexture.h"
17 #include "GrTexturePriv.h"
18 #include "SkCanvas.h" 17 #include "SkCanvas.h"
19 18
20 enum { 19 enum {
21 CACHE_SIZE_COUNT = 2048, 20 CACHE_SIZE_COUNT = 2048,
22 CACHE_SIZE_BYTES = 2 * 1024 * 1024, 21 CACHE_SIZE_BYTES = 2 * 1024 * 1024,
23 }; 22 };
24 23
25 class StencilResource : public GrGpuResource { 24 class StencilResource : public GrGpuResource {
26 public: 25 public:
27 SK_DECLARE_INST_COUNT(StencilResource); 26 SK_DECLARE_INST_COUNT(StencilResource);
(...skipping 28 matching lines...) Expand all
56 this->registerWithCache(); 55 this->registerWithCache();
57 } 56 }
58 57
59 virtual ~TextureResource() { this->release(); } 58 virtual ~TextureResource() { this->release(); }
60 59
61 virtual size_t gpuMemorySize() const SK_OVERRIDE { 60 virtual size_t gpuMemorySize() const SK_OVERRIDE {
62 return 100 + ((fID % 1 == 0) ? -40 : 33); 61 return 100 + ((fID % 1 == 0) ? -40 : 33);
63 } 62 }
64 63
65 static GrResourceKey ComputeKey(const GrTextureDesc& desc) { 64 static GrResourceKey ComputeKey(const GrTextureDesc& desc) {
66 return GrTexturePriv::ComputeScratchKey(desc); 65 return GrTextureImpl::ComputeScratchKey(desc);
67 } 66 }
68 67
69 int fID; 68 int fID;
70 69
71 private: 70 private:
72 typedef GrGpuResource INHERITED; 71 typedef GrGpuResource INHERITED;
73 }; 72 };
74 73
75 static void get_stencil(int i, int* w, int* h, int* s) { 74 static void get_stencil(int i, int* w, int* h, int* s) {
76 *w = i % 1024; 75 *w = i % 1024;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 230 }
232 231
233 private: 232 private:
234 typedef Benchmark INHERITED; 233 typedef Benchmark INHERITED;
235 }; 234 };
236 235
237 DEF_BENCH( return new GrResourceCacheBenchAdd(); ) 236 DEF_BENCH( return new GrResourceCacheBenchAdd(); )
238 DEF_BENCH( return new GrResourceCacheBenchFind(); ) 237 DEF_BENCH( return new GrResourceCacheBenchFind(); )
239 238
240 #endif 239 #endif
OLDNEW
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698