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

Unified Diff: src/core/SkEdge.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
Index: src/core/SkEdge.cpp
diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp
index 8904ca727b99fa08835985529fde208a4a802ec6..9ce255843f66c05ae0e28220dcbd4e0626c30804 100644
--- a/src/core/SkEdge.cpp
+++ b/src/core/SkEdge.cpp
@@ -36,19 +36,11 @@ int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip,
SkFDot6 x0, y0, x1, y1;
{
-#ifdef SK_SCALAR_IS_FLOAT
float scale = float(1 << (shift + 6));
x0 = int(p0.fX * scale);
y0 = int(p0.fY * scale);
x1 = int(p1.fX * scale);
y1 = int(p1.fY * scale);
-#else
- shift = 10 - shift;
- x0 = p0.fX >> shift;
- y0 = p0.fY >> shift;
- x1 = p1.fX >> shift;
- y1 = p1.fY >> shift;
-#endif
}
int winding = 1;
@@ -179,7 +171,6 @@ int SkQuadraticEdge::setQuadratic(const SkPoint pts[3], int shift)
SkFDot6 x0, y0, x1, y1, x2, y2;
{
-#ifdef SK_SCALAR_IS_FLOAT
float scale = float(1 << (shift + 6));
x0 = int(pts[0].fX * scale);
y0 = int(pts[0].fY * scale);
@@ -187,15 +178,6 @@ int SkQuadraticEdge::setQuadratic(const SkPoint pts[3], int shift)
y1 = int(pts[1].fY * scale);
x2 = int(pts[2].fX * scale);
y2 = int(pts[2].fY * scale);
-#else
- shift = 10 - shift;
- x0 = pts[0].fX >> shift;
- y0 = pts[0].fY >> shift;
- x1 = pts[1].fX >> shift;
- y1 = pts[1].fY >> shift;
- x2 = pts[2].fX >> shift;
- y2 = pts[2].fY >> shift;
-#endif
}
int winding = 1;
@@ -339,7 +321,6 @@ int SkCubicEdge::setCubic(const SkPoint pts[4], const SkIRect* clip, int shift)
SkFDot6 x0, y0, x1, y1, x2, y2, x3, y3;
{
-#ifdef SK_SCALAR_IS_FLOAT
float scale = float(1 << (shift + 6));
x0 = int(pts[0].fX * scale);
y0 = int(pts[0].fY * scale);
@@ -349,17 +330,6 @@ int SkCubicEdge::setCubic(const SkPoint pts[4], const SkIRect* clip, int shift)
y2 = int(pts[2].fY * scale);
x3 = int(pts[3].fX * scale);
y3 = int(pts[3].fY * scale);
-#else
- shift = 10 - shift;
- x0 = pts[0].fX >> shift;
- y0 = pts[0].fY >> shift;
- x1 = pts[1].fX >> shift;
- y1 = pts[1].fY >> shift;
- x2 = pts[2].fX >> shift;
- y2 = pts[2].fY >> shift;
- x3 = pts[3].fX >> shift;
- y3 = pts[3].fY >> shift;
-#endif
}
int winding = 1;
« src/core/SkCanvas.cpp ('K') | « src/core/SkEdge.h ('k') | src/core/SkFDot6.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698