Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: gm/imagefiltersscaled.cpp

Issue 198013002: Added Z scale when X and Y scale to spot lights and point lights (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersscaled.cpp
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index 809e7ea3445937dc3526586a61f4728756a0beaf..5dca30b822af86f67252c920d5954592c60d7f37 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -12,6 +12,7 @@
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
#include "SkGradientShader.h"
+#include "SkLightingImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
#include "SkPerlinNoiseShader.h"
@@ -35,7 +36,7 @@ protected:
}
virtual SkISize onISize() {
- return make_isize(1140, 500);
+ return make_isize(1428, 500);
}
void make_checkerboard() {
@@ -91,6 +92,15 @@ protected:
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
+ SkPoint3 pointLocation(0, 0, SkIntToScalar(10));
+ SkPoint3 spotLocation(SkIntToScalar(-10), SkIntToScalar(-10), SkIntToScalar(20));
+ SkPoint3 spotTarget(SkIntToScalar(40), SkIntToScalar(40), 0);
+ SkScalar spotExponent = SK_Scalar1;
+ SkScalar cutoffAngle = SkIntToScalar(15);
+ SkScalar kd = SkIntToScalar(2);
+ SkScalar surfaceScale = SkIntToScalar(1);
+ SkColor white(0xFFFFFFFF);
+
SkImageFilter* filters[] = {
SkBlurImageFilter::Create(SkIntToScalar(4), SkIntToScalar(4)),
SkDropShadowImageFilter::Create(SkIntToScalar(5), SkIntToScalar(10), SkIntToScalar(3),
@@ -105,6 +115,9 @@ protected:
SkOffsetImageFilter::Create(SkIntToScalar(32), 0),
SkResizeImageFilter::Create(RESIZE_FACTOR, RESIZE_FACTOR, SkPaint::kNone_FilterLevel),
SkRectShaderImageFilter::Create(noise),
+ SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd),
+ SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget, spotExponent,
+ cutoffAngle, white, surfaceScale, kd),
};
SkVector scales[] = {
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698