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

Unified Diff: src/utils/SkLua.cpp

Issue 2141733002: Add hard stop count (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary code in SkLua.cpp Created 4 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 | « no previous file | tools/lua/gradients.lua » ('j') | tools/lua/gradients.lua » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLua.cpp
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index e6d5d4c5ffa10145e5b3be7baa39385eb65a03e2..d2ff5551af1854095c8cc654014bb03131134f18 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1275,23 +1275,10 @@ static int lshader_asAGradient(lua_State* L) {
info.fColorOffsets = pos.get();
shader->asAGradient(&info);
- bool containsHardStops = false;
- bool isEvenlySpaced = true;
- for (int i = 1; i < info.fColorCount; i++) {
- if (SkScalarNearlyEqual(info.fColorOffsets[i], info.fColorOffsets[i-1])) {
- containsHardStops = true;
- }
- if (!SkScalarNearlyEqual(info.fColorOffsets[i], i/(info.fColorCount - 1.0f))) {
- isEvenlySpaced = false;
- }
- }
-
lua_newtable(L);
- setfield_string(L, "type", gradtype2string(t));
- setfield_string(L, "tile", mode2string(info.fTileMode));
- setfield_number(L, "colorCount", info.fColorCount);
- setfield_boolean(L, "containsHardStops", containsHardStops);
- setfield_boolean(L, "isEvenlySpaced", isEvenlySpaced);
+ setfield_string(L, "type", gradtype2string(t));
+ setfield_string(L, "tile", mode2string(info.fTileMode));
+ setfield_number(L, "colorCount", info.fColorCount);
lua_newtable(L);
for (int i = 0; i < info.fColorCount; i++) {
« no previous file with comments | « no previous file | tools/lua/gradients.lua » ('j') | tools/lua/gradients.lua » ('J')

Powered by Google App Engine
This is Rietveld 408576698