gradient api sans (deprecated) unitmapper
BUG=skia: R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/293643004 git-svn-id: http://skia.googlecode.com/svn/trunk@14781 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
da797e1c1f
commit
7b1715215a
@ -52,6 +52,14 @@ public:
|
|||||||
uint32_t flags = 0,
|
uint32_t flags = 0,
|
||||||
const SkMatrix* localMatrix = NULL);
|
const SkMatrix* localMatrix = NULL);
|
||||||
|
|
||||||
|
static SkShader* CreateLinear(const SkPoint pts[2],
|
||||||
|
const SkColor colors[], const SkScalar pos[], int count,
|
||||||
|
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.
|
/** Returns a shader that generates a radial gradient given the center and radius.
|
||||||
<p />
|
<p />
|
||||||
CreateRadial returns a shader with a reference count of 1.
|
CreateRadial returns a shader with a reference count of 1.
|
||||||
@ -76,6 +84,14 @@ public:
|
|||||||
uint32_t flags = 0,
|
uint32_t flags = 0,
|
||||||
const SkMatrix* localMatrix = NULL);
|
const SkMatrix* localMatrix = NULL);
|
||||||
|
|
||||||
|
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) {
|
||||||
|
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.
|
/** Returns a shader that generates a radial gradient given the start position, start radius, end position and end radius.
|
||||||
<p />
|
<p />
|
||||||
CreateTwoPointRadial returns a shader with a reference count of 1.
|
CreateTwoPointRadial returns a shader with a reference count of 1.
|
||||||
@ -107,6 +123,19 @@ public:
|
|||||||
uint32_t flags = 0,
|
uint32_t flags = 0,
|
||||||
const SkMatrix* localMatrix = NULL);
|
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,
|
||||||
|
NULL, flags, localMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a shader that generates a conical gradient given two circles, or
|
* Returns a shader that generates a conical gradient given two circles, or
|
||||||
* returns NULL if the inputs are invalid. The gradient interprets the
|
* returns NULL if the inputs are invalid. The gradient interprets the
|
||||||
@ -124,6 +153,19 @@ public:
|
|||||||
uint32_t flags = 0,
|
uint32_t flags = 0,
|
||||||
const SkMatrix* localMatrix = NULL);
|
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,
|
||||||
|
NULL, flags, localMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns a shader that generates a sweep gradient given a center.
|
/** Returns a shader that generates a sweep gradient given a center.
|
||||||
<p />
|
<p />
|
||||||
CreateSweep returns a shader with a reference count of 1.
|
CreateSweep returns a shader with a reference count of 1.
|
||||||
@ -146,6 +188,12 @@ public:
|
|||||||
uint32_t flags = 0,
|
uint32_t flags = 0,
|
||||||
const SkMatrix* localMatrix = NULL);
|
const SkMatrix* localMatrix = NULL);
|
||||||
|
|
||||||
|
static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
|
||||||
|
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()
|
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user