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

Unified Diff: bench/GrResourceCacheBench.cpp

Issue 702413003: Make GrGpuResource::gpuMemorySize non-virtual w/ onGpuMemorySize virtual impl (Closed) Base URL: https://skia.googlesource.com/skia.git@priv
Patch Set: rebase Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrGpuResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GrResourceCacheBench.cpp
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 91c77fb589c4c4617ad0814026fd53d4cf4591bb..6d631ddb2c4b62f74420a8c32f5c9816f7012403 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -36,10 +36,6 @@ public:
virtual ~StencilResource() { this->release(); }
- virtual size_t gpuMemorySize() const SK_OVERRIDE {
- return 100 + ((fID % 1 == 0) ? -5 : 6);
- }
-
static GrResourceKey ComputeKey(int width, int height, int sampleCnt) {
return GrStencilBuffer::ComputeKey(width, height, sampleCnt);
}
@@ -47,6 +43,10 @@ public:
int fID;
private:
+ virtual size_t onGpuMemorySize() const SK_OVERRIDE {
+ return 100 + ((fID % 1 == 0) ? -5 : 6);
+ }
+
typedef GrGpuResource INHERITED;
};
@@ -61,10 +61,6 @@ public:
virtual ~TextureResource() { this->release(); }
- virtual size_t gpuMemorySize() const SK_OVERRIDE {
- return 100 + ((fID % 1 == 0) ? -40 : 33);
- }
-
static GrResourceKey ComputeKey(const GrSurfaceDesc& desc) {
GrCacheID::Key key;
memset(&key, 0, sizeof(key));
@@ -79,6 +75,10 @@ public:
int fID;
private:
+ virtual size_t onGpuMemorySize() const SK_OVERRIDE {
+ return 100 + ((fID % 1 == 0) ? -40 : 33);
+ }
+
typedef GrGpuResource INHERITED;
};
« 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