aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrTextureStripAtlas.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-16 14:49:16 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-16 14:49:16 +0000
commit1f47f4f7325971dd53991e2bb02da94fa7c6d962 (patch)
treea5b5dc02a15a3f3d4edeb921bda4ea1895f4ce77 /src/gpu/effects/GrTextureStripAtlas.cpp
parent71329d809a42889af8d2cadc4e43c60488a739a1 (diff)
Replaced TextureCacheEntry with GrTexture* and a back pointer to GrResourceEntry (in GrTexture)
Diffstat (limited to 'src/gpu/effects/GrTextureStripAtlas.cpp')
-rw-r--r--src/gpu/effects/GrTextureStripAtlas.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 1a8a93b90a..a1a9d0301c 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -63,6 +63,7 @@ GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc)
, fLockedRows(0)
, fDesc(desc)
, fNumRows(desc.fHeight / desc.fRowHeight)
+ , fTexture(NULL)
, fRows(SkNEW_ARRAY(AtlasRow, fNumRows))
, fLRUFront(NULL)
, fLRUBack(NULL) {
@@ -139,7 +140,7 @@ int GrTextureStripAtlas::lockRow(const SkBitmap& data) {
// Pass in the kDontFlush flag, since we know we're writing to a part of this texture
// that is not currently in use
- fDesc.fContext->internalWriteTexturePixels(fEntry.texture(), 0,
+ fDesc.fContext->internalWriteTexturePixels(fTexture, 0,
rowNumber * fDesc.fRowHeight,
fDesc.fWidth,
fDesc.fRowHeight,
@@ -182,20 +183,20 @@ void GrTextureStripAtlas::lockTexture() {
texDesc.fConfig = fDesc.fConfig;
GrCacheData cacheData(fCacheID);
cacheData.fResourceDomain = GetTextureStripAtlasDomain();
- fEntry = fDesc.fContext->findAndLockTexture(texDesc, cacheData, &params);
- if (NULL == fEntry.texture()) {
- fEntry = fDesc.fContext->createAndLockTexture(&params, texDesc, cacheData, NULL, 0);
+ fTexture = fDesc.fContext->findAndLockTexture(texDesc, cacheData, &params);
+ if (NULL == fTexture) {
+ fTexture = fDesc.fContext->createAndLockTexture(&params, texDesc, cacheData, NULL, 0);
// This is a new texture, so all of our cache info is now invalid
this->initLRU();
fKeyTable.rewind();
}
- GrAssert(NULL != fEntry.texture());
+ GrAssert(NULL != fTexture);
}
void GrTextureStripAtlas::unlockTexture() {
- GrAssert(NULL != fEntry.texture() && 0 == fLockedRows);
- fDesc.fContext->unlockTexture(fEntry);
- fEntry.reset();
+ GrAssert(NULL != fTexture && 0 == fLockedRows);
+ fDesc.fContext->unlockTexture(fTexture);
+ fTexture = NULL;
}
void GrTextureStripAtlas::initLRU() {
@@ -311,9 +312,9 @@ void GrTextureStripAtlas::validate() {
// If we have locked rows, we should have a locked texture, otherwise
// it should be unlocked
if (fLockedRows == 0) {
- GrAssert(NULL == fEntry.texture());
+ GrAssert(NULL == fTexture);
} else {
- GrAssert(NULL != fEntry.texture());
+ GrAssert(NULL != fTexture);
}
}
#endif