aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMaskFilter.cpp
diff options
context:
space:
mode:
authorGravatar qiankun.miao <qiankun.miao@intel.com>2015-01-07 19:20:49 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-07 19:20:49 -0800
commiteabd0d73eebb940ec5ea06625f612a80156b61db (patch)
treeeccab3cb3ab4aea0a1a5d9ee191e6f073fcbcaed /src/core/SkMaskFilter.cpp
parent5a5b4e900ee69540fc35952882a323c63d6d0db9 (diff)
Revert of Cache blur mask for rects which can not break into nine-patch (patchset #10 id:200001 of https://codereview.chromium.org/729463002/)
Reason for revert: revert it due to a memory leak. ==8017==ERROR: LeakSanitizer: detected memory leaks Direct leak of 25992 byte(s) in 2 object(s) allocated from: #0 0x7feb53030e0b in __interceptor_malloc (/home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/gm+0x24fe0b) #1 0x7feb54d54f76 in sk_malloc_flags(unsigned long, unsigned int) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/ports/SkMemory_malloc.cpp:54:15 #2 0x7feb54d54d4a in sk_malloc_throw(unsigned long) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/ports/SkMemory_malloc.cpp:40:12 #3 0x7feb539f5a77 in SkMask::AllocImage(unsigned long) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMask.cpp:37:22 #4 0x7feb53fe5c34 in (anonymous namespace)::copy_cacheddata_to_mask(SkCachedData*, SkMask*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMaskCache.cpp:25:20 #5 0x7feb53fea064 in SkMaskCache::FindAndCopy(float, SkBlurStyle, SkBlurQuality, SkRect const*, int, SkMask*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMaskCache.cpp:224:26 #6 0x7feb539f957e in SkMaskFilter::filterPath(SkPath const&, SkMatrix const&, SkRasterClip const&, SkBlitter*, SkPaint::Style) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMaskFilter.cpp:270:14 #7 0x7feb5392e920 in SkDraw::drawPath(SkPath const&, SkPaint const&, SkMatrix const*, bool, bool, SkBlitter*) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkDraw.cpp:1117:13 #8 0x7feb53694afc in SkDraw::drawPath(SkPath const&, SkPaint const&, SkMatrix const*, bool) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../include/core/SkDraw.h:54:9 #9 0x7feb5368d799 in SkBitmapDevice::drawPath(SkDraw const&, SkPath const&, SkPaint const&, SkMatrix const*, bool) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkBitmapDevice.cpp:216:5 #10 0x7feb5386aa57 in SkCanvas::onDrawPath(SkPath const&, SkPaint const&) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkCanvas.cpp:1908:9 #11 0x7feb5386386b in SkCanvas::drawPath(SkPath const&, SkPaint const&) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkCanvas.cpp:1703:5 #12 0x7feb53109572 in Blur2RectsNonNinePatchGM::onDraw(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-000/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/blurs.cpp:166:9 Original issue's description: > Cache blur mask for rects which can not break into nine-patch > > With this CL performance improves: > blurrectsnonninepatch 42.4us -> 20.5us 0.48x > > BUG=431021,skia:3118 > > Committed: https://skia.googlesource.com/skia/+/5a5b4e900ee69540fc35952882a323c63d6d0db9 TBR=reed@google.com,humper@google.com,reed@chromium.org NOTREECHECKS=true NOTRY=true BUG=431021,skia:3118 Review URL: https://codereview.chromium.org/844673002
Diffstat (limited to 'src/core/SkMaskFilter.cpp')
-rw-r--r--src/core/SkMaskFilter.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp
index 3a4e3a41e9..c9783e76d6 100644
--- a/src/core/SkMaskFilter.cpp
+++ b/src/core/SkMaskFilter.cpp
@@ -10,7 +10,6 @@
#include "SkMaskFilter.h"
#include "SkBlitter.h"
#include "SkDraw.h"
-#include "SkMaskCache.h"
#include "SkRasterClip.h"
#include "SkRRect.h"
#include "SkTypes.h"
@@ -264,41 +263,9 @@ bool SkMaskFilter::filterPath(const SkPath& devPath, const SkMatrix& matrix,
}
SkAutoMaskFreeImage autoSrc(srcM.fImage);
- BlurRec rec;
- if (this->asABlur(&rec) && rectCount) {
- SkScalar scaledSigma = matrix.mapRadius(rec.fSigma);
- if (!SkMaskCache::FindAndCopy(scaledSigma, rec.fStyle, rec.fQuality,
- rects, rectCount, &dstM)) {
- if (!this->filterMask(&dstM, srcM, matrix, NULL)) {
- return false;
- }
- SkMaskCache::AddAndCopy(scaledSigma, rec.fStyle, rec.fQuality, rects, rectCount, dstM);
- } else {
- // Compute the correct bounds of dst mask if dst mask is got from cache.
- SkMask tmpSrc, tmpDst;
- tmpSrc = srcM;
- tmpSrc.fImage = NULL;
- if (!this->filterMask(&tmpDst, tmpSrc, matrix, NULL)) {
- return false;
- }
-
- // Fallback to original calculation if size of bounds is different with
- // size of the cached mask.
- if (dstM.fBounds.width() != tmpDst.fBounds.width() ||
- dstM.fBounds.height() != tmpDst.fBounds.height()) {
- if (!this->filterMask(&dstM, srcM, matrix, NULL)) {
- return false;
- }
- } else {
- dstM.fBounds = tmpDst.fBounds;
- }
- }
- } else {
- if (!this->filterMask(&dstM, srcM, matrix, NULL)) {
- return false;
- }
+ if (!this->filterMask(&dstM, srcM, matrix, NULL)) {
+ return false;
}
-
SkAutoMaskFreeImage autoDst(dstM.fImage);
// if we get here, we need to (possibly) resolve the clip and blitter