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

Unified Diff: include/effects/SkLightingImageFilter.h

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 | « gyp/skia_for_chromium_defines.gypi ('k') | include/effects/SkPoint3.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkLightingImageFilter.h
diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h
index e5048eeac75b6f9886f4109ade542f26edd2b68d..326e7b89678e280c2eb3f953e9da764abee48cbf 100644
--- a/include/effects/SkLightingImageFilter.h
+++ b/include/effects/SkLightingImageFilter.h
@@ -11,35 +11,12 @@
#include "SkImageFilter.h"
#include "SkColor.h"
-class SK_API SkPoint3 {
-public:
- SkPoint3() {}
- SkPoint3(SkScalar x, SkScalar y, SkScalar z)
- : fX(x), fY(y), fZ(z) {}
- SkScalar dot(const SkPoint3& other) const {
- return fX * other.fX + fY * other.fY + fZ * other.fZ;
- }
- SkScalar maxComponent() const {
- return fX > fY ? (fX > fZ ? fX : fZ) : (fY > fZ ? fY : fZ);
- }
- void normalize() {
- // Small epsilon is added to prevent division by 0.
- SkScalar scale = SkScalarInvert(SkScalarSqrt(dot(*this)) + SK_ScalarNearlyZero);
- fX = fX * scale;
- fY = fY * scale;
- fZ = fZ * scale;
- }
- SkPoint3 operator*(SkScalar scalar) const {
- return SkPoint3(fX * scalar, fY * scalar, fZ * scalar);
- }
- SkPoint3 operator-(const SkPoint3& other) const {
- return SkPoint3(fX - other.fX, fY - other.fY, fZ - other.fZ);
- }
- bool operator==(const SkPoint3& other) const {
- return fX == other.fX && fY == other.fY && fZ == other.fZ;
- }
- SkScalar fX, fY, fZ;
-};
+#ifdef SK_LEGACY_SKPOINT3_CTORS
+// TODO: remove this. Chromium relies on having this included here
+#include "SkPoint3.h"
+#else
+struct SkPoint3;
+#endif
class SkLight;
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/effects/SkPoint3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698