OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkSweepGradient.h" | 9 #include "SkSweepGradient.h" |
10 | 10 |
11 SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy, | 11 SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy, |
12 const Descriptor& desc) | 12 const Descriptor& desc, const SkMatrix* localMa
trix) |
13 : SkGradientShaderBase(desc) | 13 : SkGradientShaderBase(desc, localMatrix) |
14 , fCenter(SkPoint::Make(cx, cy)) | 14 , fCenter(SkPoint::Make(cx, cy)) |
15 { | 15 { |
16 fPtsToUnit.setTranslate(-cx, -cy); | 16 fPtsToUnit.setTranslate(-cx, -cy); |
17 | 17 |
18 // overwrite the tilemode to a canonical value (since sweep ignores it) | 18 // overwrite the tilemode to a canonical value (since sweep ignores it) |
19 fTileMode = SkShader::kClamp_TileMode; | 19 fTileMode = SkShader::kClamp_TileMode; |
20 } | 20 } |
21 | 21 |
22 SkShader::BitmapType SkSweepGradient::asABitmap(SkBitmap* bitmap, | 22 SkShader::BitmapType SkSweepGradient::asABitmap(SkBitmap* bitmap, |
23 SkMatrix* matrix, SkShader::TileMode* xy) const { | 23 SkMatrix* matrix, SkShader::TileMode* xy) const { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 str->appendScalar(fCenter.fX); | 311 str->appendScalar(fCenter.fX); |
312 str->append(", "); | 312 str->append(", "); |
313 str->appendScalar(fCenter.fY); | 313 str->appendScalar(fCenter.fY); |
314 str->append(") "); | 314 str->append(") "); |
315 | 315 |
316 this->INHERITED::toString(str); | 316 this->INHERITED::toString(str); |
317 | 317 |
318 str->append(")"); | 318 str->append(")"); |
319 } | 319 } |
320 #endif | 320 #endif |
OLD | NEW |