aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BlurTest.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-11-28 17:54:23 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-29 02:33:28 +0000
commit1ba5bfe59056f7d8c040628508a20ee95cc6b76a (patch)
treecddc987ccadf6cbf5e4d9082af0c189a19d8a663 /tests/BlurTest.cpp
parent7b8e30a196928c5907f4b67bf6b71e02a913fdb0 (diff)
Avoid double-destruction of Sk3DShaderContext-wrapped objects
Sk3DShaderContext creates its nested shader context on a SkArenaAlloc, which handles destruction when going out of scope. Hence, the explicit context dtor call in ~Sk3DShaderContext() is incorrect (likely left over from before SkArenaAlloc). BUG=chromium:787712 Change-Id: I176222e449151dcce532a839ef9587d06f61d297 Reviewed-on: https://skia-review.googlesource.com/77203 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'tests/BlurTest.cpp')
-rw-r--r--tests/BlurTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index ba63f01cf4..6c5ef269d7 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -15,6 +15,8 @@
#include "SkMath.h"
#include "SkPaint.h"
#include "SkPath.h"
+#include "SkPerlinNoiseShader.h"
+#include "SkSurface.h"
#include "Test.h"
#if SK_SUPPORT_GPU
@@ -651,4 +653,18 @@ DEF_TEST(BlurredRRectNinePatchComputation, reporter) {
}
+// https://crbugs.com/787712
+DEF_TEST(EmbossPerlinCrash, reporter) {
+ SkPaint p;
+
+ static constexpr SkEmbossMaskFilter::Light light = {
+ { 1, 1, 1 }, 0, 127, 127
+ };
+ p.setMaskFilter(SkEmbossMaskFilter::Make(1, light));
+ p.setShader(SkPerlinNoiseShader::MakeFractalNoise(1.0f, 1.0f, 2, 0.0f));
+
+ sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(100, 100);
+ surface->getCanvas()->drawPaint(p);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////