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

Unified Diff: src/gpu/GrLayerCache.cpp

Issue 640773004: Add clip to layer cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698