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

Unified Diff: src/core/SkPoint.cpp

Issue 2023693002: Handle stroked single line special case in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bugs Created 4 years, 7 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 | « no previous file | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPoint.cpp
diff --git a/src/core/SkPoint.cpp b/src/core/SkPoint.cpp
index 490e4a2d2da5c3ed9b6b82cd4ce4ed817668bd69..162c62acad7059fbd4cb658974f9f143b7a91f38 100644
--- a/src/core/SkPoint.cpp
+++ b/src/core/SkPoint.cpp
@@ -88,8 +88,8 @@ static inline float getLengthSquared(float dx, float dy) {
// This logic is encapsulated in a helper method to make it explicit that we
// always perform this check in the same manner, to avoid inconsistencies
// (see http://code.google.com/p/skia/issues/detail?id=560 ).
-static inline bool isLengthNearlyZero(float dx, float dy,
- float *lengthSquared) {
+static inline bool is_length_nearly_zero(float dx, float dy,
+ float *lengthSquared) {
*lengthSquared = getLengthSquared(dx, dy);
return *lengthSquared <= (SK_ScalarNearlyZero * SK_ScalarNearlyZero);
}
@@ -98,7 +98,7 @@ SkScalar SkPoint::Normalize(SkPoint* pt) {
float x = pt->fX;
float y = pt->fY;
float mag2;
- if (isLengthNearlyZero(x, y, &mag2)) {
+ if (is_length_nearly_zero(x, y, &mag2)) {
pt->set(0, 0);
return 0;
}
@@ -146,7 +146,7 @@ SkScalar SkPoint::Length(SkScalar dx, SkScalar dy) {
*/
bool SkPoint::setLength(float x, float y, float length) {
float mag2;
- if (isLengthNearlyZero(x, y, &mag2)) {
+ if (is_length_nearly_zero(x, y, &mag2)) {
this->set(0, 0);
return false;
}
@@ -183,7 +183,7 @@ bool SkPoint::setLengthFast(float length) {
bool SkPoint::setLengthFast(float x, float y, float length) {
float mag2;
- if (isLengthNearlyZero(x, y, &mag2)) {
+ if (is_length_nearly_zero(x, y, &mag2)) {
this->set(0, 0);
return false;
}
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698