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

Unified Diff: src/gpu/GrResourceCache2.cpp

Issue 718493002: Move GrResourceKey static functions from .h to .cpp to fix shared lib builds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « include/gpu/GrResourceKey.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache2.cpp
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 65e522aafbae13b310600138b4fee6f229bdce98..f7c9a7a119faf6d1ab3d23e8dd85fe30a4d5981e 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -10,6 +10,25 @@
#include "GrResourceCache2.h"
#include "GrGpuResource.h"
+GrResourceKey& GrResourceKey::NullScratchKey() {
+ static const GrCacheID::Key kBogusKey = { { {0} } };
+ static GrCacheID kBogusID(ScratchDomain(), kBogusKey);
+ static GrResourceKey kNullScratchKey(kBogusID, NoneResourceType(), 0);
+ return kNullScratchKey;
+}
+
+GrResourceKey::ResourceType GrResourceKey::NoneResourceType() {
+ static const ResourceType gNoneResourceType = GenerateResourceType();
+ return gNoneResourceType;
+}
+
+GrCacheID::Domain GrResourceKey::ScratchDomain() {
+ static const GrCacheID::Domain gDomain = GrCacheID::GenerateDomain();
+ return gDomain;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
GrResourceCache2::~GrResourceCache2() {
this->releaseAll();
}
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698