aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-20 14:23:26 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-20 14:23:26 +0000
commit0b6ad2297fbf43466950690102c1c9c150f2a972 (patch)
treee0e56f66070ce6edef1c8545bad5d1ec075ecd2e /src/gpu/effects
parent4b86e3428b115202e82d49a0914ea8ab6dc25940 (diff)
Revert 6914 to fix build issues.
git-svn-id: http://skia.googlecode.com/svn/trunk@6915 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrTextureStripAtlas.cpp18
-rw-r--r--src/gpu/effects/GrTextureStripAtlas.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 30d7ce4d48..92f5ad5c6f 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -17,6 +17,9 @@
#define VALIDATE
#endif
+GR_DEFINE_RESOURCE_CACHE_DOMAIN(GrTextureStripAtlas, GetTextureStripAtlasDomain)
+
+
int32_t GrTextureStripAtlas::gCacheCount = 0;
GrTHashTable<GrTextureStripAtlas::AtlasEntry,
@@ -70,7 +73,7 @@ GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::De
}
GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc)
- : fCacheKey(sk_atomic_inc(&gCacheCount))
+ : fCacheID(sk_atomic_inc(&gCacheCount))
, fLockedRows(0)
, fDesc(desc)
, fNumRows(desc.fHeight / desc.fRowHeight)
@@ -195,16 +198,11 @@ void GrTextureStripAtlas::lockTexture() {
texDesc.fWidth = fDesc.fWidth;
texDesc.fHeight = fDesc.fHeight;
texDesc.fConfig = fDesc.fConfig;
-
- static const GrCacheID::Domain gTextureStripAtlasDomain = GrCacheID::GenerateDomain();
- GrCacheID::Key key;
- *key.fData32 = fCacheKey;
- memset(key.fData32 + 1, 0, sizeof(key) - sizeof(uint32_t));
- GrCacheID cacheID(gTextureStripAtlasDomain, key);
-
- fTexture = fDesc.fContext->findTexture(texDesc, cacheID, &params);
+ GrCacheData cacheData(fCacheID);
+ cacheData.fResourceDomain = GetTextureStripAtlasDomain();
+ fTexture = fDesc.fContext->findTexture(texDesc, cacheData, &params);
if (NULL == fTexture) {
- fTexture = fDesc.fContext->createTexture(&params, texDesc, cacheID, NULL, 0);
+ fTexture = fDesc.fContext->createTexture(&params, texDesc, cacheData, NULL, 0);
// This is a new texture, so all of our cache info is now invalid
this->initLRU();
fKeyTable.rewind();
diff --git a/src/gpu/effects/GrTextureStripAtlas.h b/src/gpu/effects/GrTextureStripAtlas.h
index 1e1e5088c7..210d88ec90 100644
--- a/src/gpu/effects/GrTextureStripAtlas.h
+++ b/src/gpu/effects/GrTextureStripAtlas.h
@@ -21,6 +21,8 @@
*/
class GrTextureStripAtlas {
public:
+ GR_DECLARE_RESOURCE_CACHE_DOMAIN(GetTextureStripAtlasDomain)
+
/**
* Descriptor struct which we'll use as a hash table key
**/
@@ -155,7 +157,7 @@ private:
// A unique ID for this texture (formed with: gCacheCount++), so we can be sure that if we
// get a texture back from the texture cache, that it's the same one we last used.
- const int32_t fCacheKey;
+ const uint64_t fCacheID;
// Total locks on all rows (when this reaches zero, we can unlock our texture)
int32_t fLockedRows;