Index: include/effects/SkGradientShader.h |
diff --git a/include/effects/SkGradientShader.h b/include/effects/SkGradientShader.h |
index 871b34a41f9069747dc4dc7951806d00b23cd490..93fd8bef0f0af109797167d750b54f619de3485f 100644 |
--- a/include/effects/SkGradientShader.h |
+++ b/include/effects/SkGradientShader.h |
@@ -10,8 +10,6 @@ |
#include "SkShader.h" |
-class SkUnitMapper; |
- |
/** \class SkGradientShader |
SkGradientShader hosts factories for creating subclasses of SkShader that |
@@ -48,9 +46,24 @@ public: |
static SkShader* CreateLinear(const SkPoint pts[2], |
const SkColor colors[], const SkScalar pos[], int count, |
SkShader::TileMode mode, |
- SkUnitMapper* mapper = NULL, |
- uint32_t flags = 0, |
- const SkMatrix* localMatrix = NULL); |
+ uint32_t flags, const SkMatrix* localMatrix); |
+ |
+ static SkShader* CreateLinear(const SkPoint pts[2], |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode) { |
+ return CreateLinear(pts, colors, pos, count, mode, 0, NULL); |
+ } |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEADUNITMAPPERTYPE |
+ static SkShader* CreateLinear(const SkPoint pts[2], |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode, |
+ SkDeadUnitMapperType*, // this type is now gone |
+ uint32_t flags, |
+ const SkMatrix* localMatrix) { |
+ return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix); |
+ } |
+#endif |
/** Returns a shader that generates a radial gradient given the center and radius. |
<p /> |
@@ -72,9 +85,23 @@ public: |
static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, |
const SkColor colors[], const SkScalar pos[], int count, |
SkShader::TileMode mode, |
- SkUnitMapper* mapper = NULL, |
- uint32_t flags = 0, |
- const SkMatrix* localMatrix = NULL); |
+ uint32_t flags, const SkMatrix* localMatrix); |
+ |
+ static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode) { |
+ return CreateRadial(center, radius, colors, pos, count, mode, 0, NULL); |
+ } |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEADUNITMAPPERTYPE |
+ static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode, |
+ SkDeadUnitMapperType*, |
+ uint32_t flags, const SkMatrix* localMatrix) { |
+ return CreateRadial(center, radius, colors, pos, count, mode, flags, localMatrix); |
+ } |
+#endif |
/** Returns a shader that generates a radial gradient given the start position, start radius, end position and end radius. |
<p /> |
@@ -96,16 +123,31 @@ public: |
@param mode The tiling mode |
@param mapper May be NULL. Callback to modify the spread of the colors. |
scroggo
2014/05/15 14:33:38
No longer needed.
reed1
2014/05/15 15:37:21
Done.
|
*/ |
- static SkShader* CreateTwoPointRadial(const SkPoint& start, |
- SkScalar startRadius, |
- const SkPoint& end, |
- SkScalar endRadius, |
- const SkColor colors[], |
- const SkScalar pos[], int count, |
+ static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
SkShader::TileMode mode, |
- SkUnitMapper* mapper = NULL, |
- uint32_t flags = 0, |
- const SkMatrix* localMatrix = NULL); |
+ uint32_t flags, const SkMatrix* localMatrix); |
+ |
+ static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode) { |
+ return CreateTwoPointRadial(start, startRadius, end, endRadius, colors, pos, count, mode, |
+ 0, NULL); |
+ } |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEADUNITMAPPERTYPE |
+ static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode, |
+ SkDeadUnitMapperType*, |
+ uint32_t flags, const SkMatrix* localMatrix) { |
+ return CreateTwoPointRadial(start, startRadius, end, endRadius, colors, pos, count, mode, |
+ flags, localMatrix) |
+ } |
+#endif |
/** |
* Returns a shader that generates a conical gradient given two circles, or |
@@ -113,16 +155,31 @@ public: |
* two circles according to the following HTML spec. |
* http://dev.w3.org/html5/2dcontext/#dom-context-2d-createradialgradient |
*/ |
- static SkShader* CreateTwoPointConical(const SkPoint& start, |
- SkScalar startRadius, |
- const SkPoint& end, |
- SkScalar endRadius, |
- const SkColor colors[], |
- const SkScalar pos[], int count, |
+ static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode, |
+ uint32_t flags, const SkMatrix* localMatrix); |
+ |
+ static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkShader::TileMode mode) { |
+ return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode, |
+ 0, NULL); |
+ } |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEADUNITMAPPERTYPE |
+ static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startRadius, |
+ const SkPoint& end, SkScalar endRadius, |
+ const SkColor colors[], const SkScalar pos[], int count, |
SkShader::TileMode mode, |
- SkUnitMapper* mapper = NULL, |
- uint32_t flags = 0, |
- const SkMatrix* localMatrix = NULL); |
+ SkDeadUnitMapperType*, |
+ uint32_t flags, const SkMatrix* localMatrix) { |
+ return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode, |
+ flags, localMatrix); |
+ } |
+#endif |
/** Returns a shader that generates a sweep gradient given a center. |
<p /> |
@@ -141,10 +198,22 @@ public: |
@param mapper May be NULL. Callback to modify the spread of the colors. |
scroggo
2014/05/15 14:33:38
No longer needed.
reed1
2014/05/15 15:37:21
Done.
|
*/ |
static SkShader* CreateSweep(SkScalar cx, SkScalar cy, |
- const SkColor colors[], const SkScalar pos[], |
- int count, SkUnitMapper* mapper = NULL, |
- uint32_t flags = 0, |
- const SkMatrix* localMatrix = NULL); |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ uint32_t flags, const SkMatrix* localMatrix); |
+ |
+ static SkShader* CreateSweep(SkScalar cx, SkScalar cy, |
+ const SkColor colors[], const SkScalar pos[], int count) { |
+ return CreateSweep(cx, cy, colors, pos, count, 0, NULL); |
+ } |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEADUNITMAPPERTYPE |
+ static SkShader* CreateSweep(SkScalar cx, SkScalar cy, |
+ const SkColor colors[], const SkScalar pos[], int count, |
+ SkDeadUnitMapperType*, |
+ uint32_t flags, const SkMatrix* localMatrix) { |
+ return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix); |
+ } |
+#endif |
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
}; |