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 |