aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefiltersclipped.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-08-26 14:26:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-26 14:26:40 -0700
commit7b7ecfc046f7ec810482266db3430d1358b7a5bf (patch)
treee286aa97d1a283811b6d533e92e771310bba3c28 /gm/imagefiltersclipped.cpp
parentd5c448fd857a77a375886bc1a8da83a7f1bf32fe (diff)
Fix clipped lighting image filters.
The CPU path for lighting image filters was not adjusting the filter matrix to accommodate srcOffset, resulting in incorrectly-positioned lights. (The GPU path was doing this correctly.) This change adds a new test case to the imagefiltersclipped GM, so it will need new baselines. BUG=skia: Review URL: https://codereview.chromium.org/1310053004
Diffstat (limited to 'gm/imagefiltersclipped.cpp')
-rw-r--r--gm/imagefiltersclipped.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gm/imagefiltersclipped.cpp b/gm/imagefiltersclipped.cpp
index 28f3e0bde9..a641ca3473 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -12,9 +12,11 @@
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
#include "SkGradientShader.h"
+#include "SkLightingImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
#include "SkPerlinNoiseShader.h"
+#include "SkPoint3.h"
#include "SkRectShaderImageFilter.h"
#include "SkScalar.h"
#include "gm.h"
@@ -95,6 +97,7 @@ protected:
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
SkMatrix resizeMatrix;
resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y);
+ SkPoint3 pointLocation = SkPoint3::Make(32, 32, SkIntToScalar(10));
SkImageFilter* filters[] = {
SkBlurImageFilter::Create(SkIntToScalar(12), SkIntToScalar(12)),
@@ -110,6 +113,8 @@ protected:
SkErodeImageFilter::Create(2, 2, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)),
SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQuality),
+ SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, SK_ColorWHITE, SK_Scalar1, SkIntToScalar(2), checkerboard.get()),
+
};
SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));