Chromium Code Reviews| Index: src/gpu/GrLayerCache.h |
| diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h |
| index c5fa236388e1915d39a127d984d3ec47d35509dd..184660837692e5963550a8b9864c372cd7f125ee 100644 |
| --- a/src/gpu/GrLayerCache.h |
| +++ b/src/gpu/GrLayerCache.h |
| @@ -82,16 +82,16 @@ public: |
| SkASSERT(SK_InvalidGenID != pictureID && layerID >= 0); |
| } |
| + ~GrCachedLayer() { |
| + SkSafeUnref(fTexture); |
| + } |
| + |
| uint32_t pictureID() const { return fKey.getPictureID(); } |
| int layerID() const { return fKey.getLayerID(); } |
| // This call takes over the caller's ref |
|
bsalomon
2014/07/30 14:10:38
Isn't this comment wrong now?
robertphillips
2014/07/30 14:19:10
Done.
|
| void setTexture(GrTexture* texture, const GrIRect16& rect) { |
| - if (NULL != fTexture) { |
| - fTexture->unref(); |
| - } |
| - |
| - fTexture = texture; // just take over caller's ref |
| + SkRefCnt_SafeAssign(fTexture, texture); |
| fRect = rect; |
| } |
| GrTexture* texture() { return fTexture; } |