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

Unified Diff: src/core/SkNormalBevelSource.cpp

Issue 2223053002: Split distance vector into direction and magnitude components (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 4 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/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalBevelSource.cpp
diff --git a/src/core/SkNormalBevelSource.cpp b/src/core/SkNormalBevelSource.cpp
index 04faa0006fa15d42d0d0e85ab490492dcc98792d..f4bd031c4c7dbccd1f433f646aa8c7ef3197d73d 100644
--- a/src/core/SkNormalBevelSource.cpp
+++ b/src/core/SkNormalBevelSource.cpp
@@ -86,10 +86,9 @@ public:
}
// Here we are splitting the distance vector into length and normalized direction
- // TODO: Output these values from the geometry processor frag code instead of the vector
- fragBuilder->codeAppendf("float dv_length = length(%s);",
+ fragBuilder->codeAppendf("float dv_length = %s.z;",
fragBuilder->distanceVectorName());
- fragBuilder->codeAppendf("vec2 dv_norm = normalize(%s);",
+ fragBuilder->codeAppendf("vec2 dv_norm = %s.xy;",
fragBuilder->distanceVectorName());
// Asserting presence of necessary uniforms
« no previous file with comments | « no previous file | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698