Move GrResourceKey static functions from .h to .cpp to fix shared lib builds
TBR=robertphillips@google.com
Review URL: https://codereview.chromium.org/718493002
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 65e522a..f7c9a7a 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();
}