aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkGradientShader.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-22 02:55:59 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-22 02:55:59 +0000
commit3339ac54a5ed75f2872ab16e9052a8b9ff3564bf (patch)
tree42852098db6117ad0f15cf332bc2aacffa322e38 /include/effects/SkGradientShader.h
parent8991c67f0c1b9364bb12dfb0f32a53bd5a3357f3 (diff)
Reason for revert: required blink change failed to land Original issue's description: > Remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/) > > This reverts commit dd50c83b5b34dab3a077741861b50ed1f2bc6b8f. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=14830 R=scroggo@google.com, reed@google.com TBR=reed@google.com, scroggo@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@chromium.org Review URL: https://codereview.chromium.org/296823008 git-svn-id: http://skia.googlecode.com/svn/trunk@14838 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkGradientShader.h')
-rw-r--r--include/effects/SkGradientShader.h97
1 files changed, 67 insertions, 30 deletions
diff --git a/include/effects/SkGradientShader.h b/include/effects/SkGradientShader.h
index a5b4f29b76..d9276c9ad9 100644
--- a/include/effects/SkGradientShader.h
+++ b/include/effects/SkGradientShader.h
@@ -10,6 +10,8 @@
#include "SkShader.h"
+class SkUnitMapper;
+
/** \class SkGradientShader
SkGradientShader hosts factories for creating subclasses of SkShader that
@@ -41,16 +43,21 @@ public:
intermediate values must be strictly increasing.
@param count Must be >=2. The number of colors (and pos if not NULL) entries.
@param mode The tiling mode
+ @param mapper May be NULL. Callback to modify the spread of the colors.
*/
static SkShader* CreateLinear(const SkPoint pts[2],
const SkColor colors[], const SkScalar pos[], int count,
SkShader::TileMode mode,
- uint32_t flags, const SkMatrix* localMatrix);
+ SkUnitMapper* mapper = NULL,
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
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);
+ SkShader::TileMode mode,
+ uint32_t flags,
+ const SkMatrix* localMatrix) {
+ return CreateLinear(pts, colors, pos, count, mode, NULL, flags, localMatrix);
}
/** Returns a shader that generates a radial gradient given the center and radius.
@@ -68,16 +75,21 @@ public:
intermediate values must be strictly increasing.
@param count Must be >= 2. The number of colors (and pos if not NULL) entries
@param mode The tiling mode
+ @param mapper May be NULL. Callback to modify the spread of the colors.
*/
static SkShader* CreateRadial(const SkPoint& center, SkScalar radius,
const SkColor colors[], const SkScalar pos[], int count,
SkShader::TileMode mode,
- uint32_t flags, const SkMatrix* localMatrix);
+ SkUnitMapper* mapper = NULL,
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
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);
+ SkShader::TileMode mode,
+ uint32_t flags,
+ const SkMatrix* localMatrix) {
+ return CreateRadial(center, radius, colors, pos, count, mode, NULL, flags, localMatrix);
}
/** Returns a shader that generates a radial gradient given the start position, start radius, end position and end radius.
@@ -98,19 +110,30 @@ public:
intermediate values must be strictly increasing.
@param count Must be >= 2. The number of colors (and pos if not NULL) entries
@param mode The tiling mode
+ @param mapper May be NULL. Callback to modify the spread of the colors.
*/
- 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,
- 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) {
+ SkUnitMapper* mapper = NULL,
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
+
+ static SkShader* CreateTwoPointRadial(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) {
return CreateTwoPointRadial(start, startRadius, end, endRadius, colors, pos, count, mode,
- 0, NULL);
+ NULL, flags, localMatrix);
}
/**
@@ -119,18 +142,28 @@ 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) {
+ SkUnitMapper* mapper = NULL,
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
+
+ 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) {
return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
- 0, NULL);
+ NULL, flags, localMatrix);
}
/** Returns a shader that generates a sweep gradient given a center.
@@ -147,14 +180,18 @@ public:
If this is not null, the values must begin with 0, end with 1.0, and
intermediate values must be strictly increasing.
@param count Must be >= 2. The number of colors (and pos if not NULL) entries
+ @param mapper May be NULL. Callback to modify the spread of the colors.
*/
static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
- const SkColor colors[], const SkScalar pos[], int count,
- uint32_t flags, const SkMatrix* localMatrix);
+ const SkColor colors[], const SkScalar pos[],
+ int count, SkUnitMapper* mapper = NULL,
+ uint32_t flags = 0,
+ const SkMatrix* localMatrix = NULL);
static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
- const SkColor colors[], const SkScalar pos[], int count) {
- return CreateSweep(cx, cy, colors, pos, count, 0, NULL);
+ const SkColor colors[], const SkScalar pos[], int count,
+ uint32_t flags, const SkMatrix* localMatrix) {
+ return CreateSweep(cx, cy, colors, pos, count, NULL, flags, localMatrix);
}
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()