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

Unified Diff: gm/lighting.cpp

Issue 1229693009: Add new SkPoint3 class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More Chromium staging Created 5 years, 5 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 | « gm/imagefiltersscaled.cpp ('k') | gyp/effects.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lighting.cpp
diff --git a/gm/lighting.cpp b/gm/lighting.cpp
index 0bfbb47a95e140a4f436a102d43629b171e3555b..6df58516b2b5f4f7118e3e24513be926ddfa065e 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -8,6 +8,7 @@
#include "gm.h"
#include "SkLightingImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkPoint3.h"
#define WIDTH 330
#define HEIGHT 660
@@ -69,14 +70,18 @@ protected:
canvas->restore();
}
}
- SkPoint3 pointLocation(0, 0, SkIntToScalar(10));
+ SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10));
SkScalar azimuthRad = SkDegreesToRadians(SkIntToScalar(225));
SkScalar elevationRad = SkDegreesToRadians(SkIntToScalar(5));
- SkPoint3 distantDirection(SkScalarMul(SkScalarCos(azimuthRad), SkScalarCos(elevationRad)),
- SkScalarMul(SkScalarSin(azimuthRad), SkScalarCos(elevationRad)),
- SkScalarSin(elevationRad));
- SkPoint3 spotLocation(SkIntToScalar(-10), SkIntToScalar(-10), SkIntToScalar(20));
- SkPoint3 spotTarget(SkIntToScalar(40), SkIntToScalar(40), 0);
+ SkPoint3 distantDirection = SkPoint3::Make(SkScalarMul(SkScalarCos(azimuthRad),
+ SkScalarCos(elevationRad)),
+ SkScalarMul(SkScalarSin(azimuthRad),
+ SkScalarCos(elevationRad)),
+ SkScalarSin(elevationRad));
+ SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10),
+ SkIntToScalar(-10),
+ SkIntToScalar(20));
+ SkPoint3 spotTarget = SkPoint3::Make(SkIntToScalar(40), SkIntToScalar(40), 0);
SkScalar spotExponent = SK_Scalar1;
SkScalar cutoffAngle = SkIntToScalar(15);
SkScalar kd = SkIntToScalar(2);
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | gyp/effects.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698