Index: src/gpu/GrLayerCache.cpp |
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp |
index 7c2a8bd61c16bbc0e1d03dc4dcd967916e84e181..154c6f3621f16c515f054f949171ab539daaa5ad 100644 |
--- a/src/gpu/GrLayerCache.cpp |
+++ b/src/gpu/GrLayerCache.cpp |
@@ -129,30 +129,33 @@ void GrLayerCache::freeAll() { |
GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID, |
int start, int stop, |
+ const SkIRect& bounds, |
const SkMatrix& ctm, |
const SkPaint* paint) { |
SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0); |
- GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop, ctm, paint)); |
+ GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop, bounds, ctm, paint)); |
fLayerHash.add(layer); |
return layer; |
} |
GrCachedLayer* GrLayerCache::findLayer(uint32_t pictureID, |
int start, |
+ const SkIRect& bounds, |
const SkMatrix& ctm) { |
SkASSERT(pictureID != SK_InvalidGenID && start > 0); |
- return fLayerHash.find(GrCachedLayer::Key(pictureID, start, ctm)); |
+ return fLayerHash.find(GrCachedLayer::Key(pictureID, start, bounds, ctm)); |
} |
GrCachedLayer* GrLayerCache::findLayerOrCreate(uint32_t pictureID, |
int start, int stop, |
+ const SkIRect& bounds, |
const SkMatrix& ctm, |
const SkPaint* paint) { |
SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0); |
- GrCachedLayer* layer = fLayerHash.find(GrCachedLayer::Key(pictureID, start, ctm)); |
+ GrCachedLayer* layer = fLayerHash.find(GrCachedLayer::Key(pictureID, start, bounds, ctm)); |
if (NULL == layer) { |
- layer = this->createLayer(pictureID, start, stop, ctm, paint); |
+ layer = this->createLayer(pictureID, start, stop, bounds, ctm, paint); |
} |
return layer; |
@@ -455,11 +458,7 @@ void GrLayerCache::writeLayersToDisk(const SkString& dirName) { |
} |
SkString fileName(dirName); |
- fileName.append("\\"); |
- fileName.appendU32(layer->fKey.pictureID()); |
- fileName.append("-"); |
- fileName.appendU32(layer->fKey.start()); |
- fileName.append(".png"); |
+ fileName.appendf("\\%d-%d.png", layer->fKey.pictureID(), layer->fKey.start()); |
layer->texture()->surfacePriv().savePixels(fileName.c_str()); |
} |