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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | no next file » | 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 2014 Google Inc. 3 * Copyright 2014 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 9
10 #include "GrResourceCache2.h" 10 #include "GrResourceCache2.h"
11 #include "GrGpuResource.h" 11 #include "GrGpuResource.h"
12 12
13 GrResourceKey& GrResourceKey::NullScratchKey() {
14 static const GrCacheID::Key kBogusKey = { { {0} } };
15 static GrCacheID kBogusID(ScratchDomain(), kBogusKey);
16 static GrResourceKey kNullScratchKey(kBogusID, NoneResourceType(), 0);
17 return kNullScratchKey;
18 }
19
20 GrResourceKey::ResourceType GrResourceKey::NoneResourceType() {
21 static const ResourceType gNoneResourceType = GenerateResourceType();
22 return gNoneResourceType;
23 }
24
25 GrCacheID::Domain GrResourceKey::ScratchDomain() {
26 static const GrCacheID::Domain gDomain = GrCacheID::GenerateDomain();
27 return gDomain;
28 }
29
30 //////////////////////////////////////////////////////////////////////////////
31
13 GrResourceCache2::~GrResourceCache2() { 32 GrResourceCache2::~GrResourceCache2() {
14 this->releaseAll(); 33 this->releaseAll();
15 } 34 }
16 35
17 void GrResourceCache2::insertResource(GrGpuResource* resource) { 36 void GrResourceCache2::insertResource(GrGpuResource* resource) {
18 SkASSERT(resource); 37 SkASSERT(resource);
19 SkASSERT(!resource->wasDestroyed()); 38 SkASSERT(!resource->wasDestroyed());
20 SkASSERT(!this->isInCache(resource)); 39 SkASSERT(!this->isInCache(resource));
21 fResources.addToHead(resource); 40 fResources.addToHead(resource);
22 ++fCount; 41 ++fCount;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 SkASSERT(resource->getContentKey()); 128 SkASSERT(resource->getContentKey());
110 129
111 GrGpuResource* res = fContentHash.find(*resource->getContentKey()); 130 GrGpuResource* res = fContentHash.find(*resource->getContentKey());
112 if (NULL != res) { 131 if (NULL != res) {
113 return false; 132 return false;
114 } 133 }
115 134
116 fContentHash.add(resource); 135 fContentHash.add(resource);
117 return true; 136 return true;
118 } 137 }
OLDNEW
« 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