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

Unified Diff: src/gpu/GrLayerCache.h

Issue 579843002: Copy layer-hoisting related SkPaints (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Copy layer hoisting related SkPaints Created 6 years, 3 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 | « no previous file | src/gpu/GrRecordReplaceDraw.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerCache.h
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index 1fb4c1001cc6710751340f2d9c89ad3ed9ee6579..38d4d9b500a73263ea14c1b81a1e3828e9818ba6 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -101,7 +101,7 @@ public:
const SkIPoint& offset, const SkMatrix& ctm,
const SkPaint* paint)
: fKey(pictureID, start, stop, offset, ctm)
- , fPaint(paint)
+ , fPaint(paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL)
, fTexture(NULL)
, fRect(GrIRect16::MakeEmpty())
, fPlot(NULL)
@@ -111,6 +111,7 @@ public:
~GrCachedLayer() {
SkSafeUnref(fTexture);
+ SkDELETE(fPaint);
}
uint32_t pictureID() const { return fKey.pictureID(); }
@@ -145,7 +146,7 @@ private:
const Key fKey;
// The paint used when dropping the layer down into the owning canvas.
- // Can be NULL.
+ // Can be NULL. This class makes a copy for itself.
const SkPaint* fPaint;
// fTexture is a ref on the atlasing texture for atlased layers and a
« no previous file with comments | « no previous file | src/gpu/GrRecordReplaceDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698