Chromium Code Reviews| Index: src/core/SkMaskFilter.cpp |
| diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp |
| index 2ab2843641a03580e698023af9b4ae05219178fb..6f9007d7d28a75e515bae5de84d0c5e4f3990351 100644 |
| --- a/src/core/SkMaskFilter.cpp |
| +++ b/src/core/SkMaskFilter.cpp |
| @@ -211,15 +211,16 @@ bool SkMaskFilter::filterRRect(const SkRRect& devRRect, const SkMatrix& matrix, |
| // cannot be used, return false to allow our caller to recover and perform |
| // the drawing another way. |
| NinePatch patch; |
| - patch.fMask.fImage = NULL; |
| + patch.fDiscardableMemoryMask.fMask.fImage = NULL; |
| if (kTrue_FilterReturn != this->filterRRectToNine(devRRect, matrix, |
| clip.getBounds(), |
| &patch)) { |
| - SkASSERT(NULL == patch.fMask.fImage); |
| + SkASSERT(NULL == patch.fDiscardableMemoryMask.fMask.fImage); |
| return false; |
| } |
| - draw_nine(patch.fMask, patch.fOuterRect, patch.fCenter, true, clip, blitter); |
| - SkMask::FreeImage(patch.fMask.fImage); |
| + draw_nine(patch.fDiscardableMemoryMask.fMask, patch.fOuterRect, patch.fCenter, true, clip, blitter); |
| + SkScaledImageCache::Unlock( |
|
reed1
2014/06/09 14:55:34
Who set fCacheId before this Unlock call?
|
| + static_cast<SkScaledImageCache::ID*>(patch.fDiscardableMemoryMask.fCacheId)); |
| return true; |
| } |
| @@ -234,21 +235,22 @@ bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix, |
| if (rectCount > 0) { |
| NinePatch patch; |
| - patch.fMask.fImage = NULL; |
| + patch.fDiscardableMemoryMask.fMask.fImage = NULL; |
| switch (this->filterRectsToNine(rects, rectCount, matrix, |
| clip.getBounds(), &patch)) { |
| case kFalse_FilterReturn: |
| - SkASSERT(NULL == patch.fMask.fImage); |
| + SkASSERT(NULL == patch.fDiscardableMemoryMask.fMask.fImage); |
| return false; |
| case kTrue_FilterReturn: |
| - draw_nine(patch.fMask, patch.fOuterRect, patch.fCenter, 1 == rectCount, clip, |
| - blitter); |
| - SkMask::FreeImage(patch.fMask.fImage); |
| + draw_nine(patch.fDiscardableMemoryMask.fMask, patch.fOuterRect, patch.fCenter, |
| + 1 == rectCount, clip, blitter); |
| + SkScaledImageCache::Unlock( |
| + static_cast<SkScaledImageCache::ID*>(patch.fDiscardableMemoryMask.fCacheId)); |
| return true; |
| case kUnimplemented_FilterReturn: |
| - SkASSERT(NULL == patch.fMask.fImage); |
| + SkASSERT(NULL == patch.fDiscardableMemoryMask.fMask.fImage); |
| // fall through |
| break; |
| } |