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

Unified Diff: src/effects/gradients/SkSweepGradient.cpp

Issue 15733007: use Descriptor struct to encapsulate all the common paramaeters between our various gradient types.… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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
Index: src/effects/gradients/SkSweepGradient.cpp
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 1e6b642260c1799e2f3e1cd03901de48ffbde25e..51433afbca351eba0ecabb7bb2f29698ae41cf53 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -8,12 +8,15 @@
#include "SkSweepGradient.h"
-SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy, const SkColor colors[],
- const SkScalar pos[], int count, SkUnitMapper* mapper)
-: SkGradientShaderBase(colors, pos, count, SkShader::kClamp_TileMode, mapper),
+SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy,
+ const Descriptor& desc)
+: SkGradientShaderBase(desc),
fCenter(SkPoint::Make(cx, cy))
{
fPtsToUnit.setTranslate(-cx, -cy);
+
+ // overwrite the tilemode to a canonical value (since sweep ignores it)
+ fTileMode = SkShader::kClamp_TileMode;
}
SkShader::BitmapType SkSweepGradient::asABitmap(SkBitmap* bitmap,

Powered by Google App Engine
This is Rietveld 408576698