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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient.h

Issue 1767163003: Use float rather than SkFixed for gradient TileProcs. (Closed) Base URL: https://skia.googlesource.com/skia@scalar-pin-to-fixed
Patch Set: Created 4 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 | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkTwoPointConicalGradient.h
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h
index 5783c39bd4769e7274064fd086ec02311d69430d..11f1afe8a26fd15ec147296fbfcf3dc8b7b99344 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h
@@ -9,15 +9,14 @@
#ifndef SkTwoPointConicalGradient_DEFINED
#define SkTwoPointConicalGradient_DEFINED
+#include "math.h"
+
#include "SkGradientShaderPriv.h"
// TODO(dominikg): Worth making it truly immutable (i.e. set values in constructor)?
// Should only be initialized once via init(). Immutable afterwards.
struct TwoPtRadial {
- enum {
- // This value is outside the range SK_FixedMin to SK_FixedMax.
- kDontDrawT = 0x80000000
- };
+ static const float kDontDrawT;
float fCenterX, fCenterY;
float fDCenterX, fDCenterY;
@@ -32,8 +31,8 @@ struct TwoPtRadial {
const SkPoint& center1, SkScalar rad1,
bool flipped);
- static bool DontDrawT(SkFixed t) {
- return kDontDrawT == (uint32_t)t;
+ static bool DontDrawT(float t) {
+ return isnan(t);
}
};
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698