| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkGradientShader_DEFINED | 8 #ifndef SkGradientShader_DEFINED |
| 9 #define SkGradientShader_DEFINED | 9 #define SkGradientShader_DEFINED |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 static SkShader* CreateLinear(const SkPoint pts[2], | 52 static SkShader* CreateLinear(const SkPoint pts[2], |
| 53 const SkColor colors[], const SkScalar pos[],
int count, | 53 const SkColor colors[], const SkScalar pos[],
int count, |
| 54 SkShader::TileMode mode) { | 54 SkShader::TileMode mode) { |
| 55 return CreateLinear(pts, colors, pos, count, mode, 0, NULL); | 55 return CreateLinear(pts, colors, pos, count, mode, 0, NULL); |
| 56 } | 56 } |
| 57 | 57 |
| 58 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES | 58 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES |
| 59 static SkShader* CreateLinear(const SkPoint pts[2], | 59 static SkShader* CreateLinear(const SkPoint pts[2], |
| 60 const SkColor colors[], const SkScalar pos[],
int count, | 60 const SkColor colors[], const SkScalar pos[],
int count, |
| 61 SkShader::TileMode mode, void* ignored, | 61 SkShader::TileMode mode, void* /*ignored*/, |
| 62 uint32_t flags, const SkMatrix* localMatrix) { | 62 uint32_t flags, const SkMatrix* localMatrix) { |
| 63 return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix); | 63 return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix); |
| 64 } | 64 } |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 /** Returns a shader that generates a radial gradient given the center and r
adius. | 67 /** Returns a shader that generates a radial gradient given the center and r
adius. |
| 68 <p /> | 68 <p /> |
| 69 CreateRadial returns a shader with a reference count of 1. | 69 CreateRadial returns a shader with a reference count of 1. |
| 70 The caller should decrement the shader's reference count when done with
the shader. | 70 The caller should decrement the shader's reference count when done with
the shader. |
| 71 It is an error for colorCount to be < 2, or for radius to be <= 0. | 71 It is an error for colorCount to be < 2, or for radius to be <= 0. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 87 | 87 |
| 88 static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, | 88 static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, |
| 89 const SkColor colors[], const SkScalar pos[],
int count, | 89 const SkColor colors[], const SkScalar pos[],
int count, |
| 90 SkShader::TileMode mode) { | 90 SkShader::TileMode mode) { |
| 91 return CreateRadial(center, radius, colors, pos, count, mode, 0, NULL); | 91 return CreateRadial(center, radius, colors, pos, count, mode, 0, NULL); |
| 92 } | 92 } |
| 93 | 93 |
| 94 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES | 94 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES |
| 95 static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, | 95 static SkShader* CreateRadial(const SkPoint& center, SkScalar radius, |
| 96 const SkColor colors[], const SkScalar pos[],
int count, | 96 const SkColor colors[], const SkScalar pos[],
int count, |
| 97 SkShader::TileMode mode, void* ignored, | 97 SkShader::TileMode mode, void* /*ignored*/, |
| 98 uint32_t flags, const SkMatrix* localMatrix) { | 98 uint32_t flags, const SkMatrix* localMatrix) { |
| 99 return CreateRadial(center, radius, colors, pos, count, mode, flags, loc
alMatrix); | 99 return CreateRadial(center, radius, colors, pos, count, mode, flags, loc
alMatrix); |
| 100 } | 100 } |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 /** Returns a shader that generates a radial gradient given the start positi
on, start radius, end position and end radius. | 103 /** Returns a shader that generates a radial gradient given the start positi
on, start radius, end position and end radius. |
| 104 <p /> | 104 <p /> |
| 105 CreateTwoPointRadial returns a shader with a reference count of 1. | 105 CreateTwoPointRadial returns a shader with a reference count of 1. |
| 106 The caller should decrement the shader's reference count when done with
the shader. | 106 The caller should decrement the shader's reference count when done with
the shader. |
| 107 It is an error for colorCount to be < 2, for startRadius or endRadius to
be < 0, or for | 107 It is an error for colorCount to be < 2, for startRadius or endRadius to
be < 0, or for |
| (...skipping 22 matching lines...) Expand all Loading... |
| 130 const SkColor colors[], const SkScalar
pos[], int count, | 130 const SkColor colors[], const SkScalar
pos[], int count, |
| 131 SkShader::TileMode mode) { | 131 SkShader::TileMode mode) { |
| 132 return CreateTwoPointRadial(start, startRadius, end, endRadius, colors,
pos, count, mode, | 132 return CreateTwoPointRadial(start, startRadius, end, endRadius, colors,
pos, count, mode, |
| 133 0, NULL); | 133 0, NULL); |
| 134 } | 134 } |
| 135 | 135 |
| 136 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES | 136 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES |
| 137 static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRa
dius, | 137 static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRa
dius, |
| 138 const SkPoint& end, SkScalar endRadius
, | 138 const SkPoint& end, SkScalar endRadius
, |
| 139 const SkColor colors[], const SkScalar
pos[], int count, | 139 const SkColor colors[], const SkScalar
pos[], int count, |
| 140 SkShader::TileMode mode, void* ignored
, | 140 SkShader::TileMode mode, void* /*ignor
ed*/, |
| 141 uint32_t flags, const SkMatrix* localM
atrix) { | 141 uint32_t flags, const SkMatrix* localM
atrix) { |
| 142 return CreateTwoPointRadial(start, startRadius, end, endRadius, colors,
pos, count, mode, | 142 return CreateTwoPointRadial(start, startRadius, end, endRadius, colors,
pos, count, mode, |
| 143 flags, localMatrix); | 143 flags, localMatrix); |
| 144 } | 144 } |
| 145 #endif | 145 #endif |
| 146 | 146 |
| 147 /** | 147 /** |
| 148 * Returns a shader that generates a conical gradient given two circles, or | 148 * Returns a shader that generates a conical gradient given two circles, or |
| 149 * returns NULL if the inputs are invalid. The gradient interprets the | 149 * returns NULL if the inputs are invalid. The gradient interprets the |
| 150 * two circles according to the following HTML spec. | 150 * two circles according to the following HTML spec. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 161 const SkColor colors[], const SkScala
r pos[], int count, | 161 const SkColor colors[], const SkScala
r pos[], int count, |
| 162 SkShader::TileMode mode) { | 162 SkShader::TileMode mode) { |
| 163 return CreateTwoPointConical(start, startRadius, end, endRadius, colors,
pos, count, mode, | 163 return CreateTwoPointConical(start, startRadius, end, endRadius, colors,
pos, count, mode, |
| 164 0, NULL); | 164 0, NULL); |
| 165 } | 165 } |
| 166 | 166 |
| 167 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES | 167 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES |
| 168 static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startR
adius, | 168 static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startR
adius, |
| 169 const SkPoint& end, SkScalar endRadiu
s, | 169 const SkPoint& end, SkScalar endRadiu
s, |
| 170 const SkColor colors[], const SkScala
r pos[], int count, | 170 const SkColor colors[], const SkScala
r pos[], int count, |
| 171 SkShader::TileMode mode, void* ignore
d, | 171 SkShader::TileMode mode, void* /*igno
red*/, |
| 172 uint32_t flags, const SkMatrix* local
Matrix) { | 172 uint32_t flags, const SkMatrix* local
Matrix) { |
| 173 return CreateTwoPointConical(start, startRadius, end, endRadius, colors,
pos, count, mode, | 173 return CreateTwoPointConical(start, startRadius, end, endRadius, colors,
pos, count, mode, |
| 174 flags, localMatrix); | 174 flags, localMatrix); |
| 175 } | 175 } |
| 176 #endif | 176 #endif |
| 177 | 177 |
| 178 /** Returns a shader that generates a sweep gradient given a center. | 178 /** Returns a shader that generates a sweep gradient given a center. |
| 179 <p /> | 179 <p /> |
| 180 CreateSweep returns a shader with a reference count of 1. | 180 CreateSweep returns a shader with a reference count of 1. |
| 181 The caller should decrement the shader's reference count when done with
the shader. | 181 The caller should decrement the shader's reference count when done with
the shader. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 195 uint32_t flags, const SkMatrix* localMatrix); | 195 uint32_t flags, const SkMatrix* localMatrix); |
| 196 | 196 |
| 197 static SkShader* CreateSweep(SkScalar cx, SkScalar cy, | 197 static SkShader* CreateSweep(SkScalar cx, SkScalar cy, |
| 198 const SkColor colors[], const SkScalar pos[], i
nt count) { | 198 const SkColor colors[], const SkScalar pos[], i
nt count) { |
| 199 return CreateSweep(cx, cy, colors, pos, count, 0, NULL); | 199 return CreateSweep(cx, cy, colors, pos, count, 0, NULL); |
| 200 } | 200 } |
| 201 | 201 |
| 202 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES | 202 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES |
| 203 static SkShader* CreateSweep(SkScalar cx, SkScalar cy, | 203 static SkShader* CreateSweep(SkScalar cx, SkScalar cy, |
| 204 const SkColor colors[], const SkScalar pos[], i
nt count, | 204 const SkColor colors[], const SkScalar pos[], i
nt count, |
| 205 void* ignored, | 205 void* /*ignored*/, |
| 206 uint32_t flags, const SkMatrix* localMatrix) { | 206 uint32_t flags, const SkMatrix* localMatrix) { |
| 207 return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix); | 207 return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix); |
| 208 } | 208 } |
| 209 #endif | 209 #endif |
| 210 | 210 |
| 211 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 211 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 #endif | 214 #endif |
| OLD | NEW |