OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 #include "SkSweepGradient.h" | 8 #include "SkSweepGradient.h" |
9 | 9 |
10 static SkMatrix translate(SkScalar dx, SkScalar dy) { | 10 static SkMatrix translate(SkScalar dx, SkScalar dy) { |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 return kSweep_GradientType; | 29 return kSweep_GradientType; |
30 } | 30 } |
31 | 31 |
32 sk_sp<SkFlattenable> SkSweepGradient::CreateProc(SkReadBuffer& buffer) { | 32 sk_sp<SkFlattenable> SkSweepGradient::CreateProc(SkReadBuffer& buffer) { |
33 DescriptorScope desc; | 33 DescriptorScope desc; |
34 if (!desc.unflatten(buffer)) { | 34 if (!desc.unflatten(buffer)) { |
35 return nullptr; | 35 return nullptr; |
36 } | 36 } |
37 const SkPoint center = buffer.readPoint(); | 37 const SkPoint center = buffer.readPoint(); |
38 return SkGradientShader::MakeSweep(center.x(), center.y(), desc.fColors, des
c.fPos, | 38 return SkGradientShader::MakeSweep(center.x(), center.y(), desc.fColors, |
39 desc.fCount, desc.fGradFlags, desc.fLocal
Matrix); | 39 std::move(desc.fColorSpace), desc.fPos, d
esc.fCount, |
| 40 desc.fGradFlags, desc.fLocalMatrix); |
40 } | 41 } |
41 | 42 |
42 void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { | 43 void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { |
43 this->INHERITED::flatten(buffer); | 44 this->INHERITED::flatten(buffer); |
44 buffer.writePoint(fCenter); | 45 buffer.writePoint(fCenter); |
45 } | 46 } |
46 | 47 |
47 size_t SkSweepGradient::onContextSize(const ContextRec&) const { | 48 size_t SkSweepGradient::onContextSize(const ContextRec&) const { |
48 return sizeof(SweepGradientContext); | 49 return sizeof(SweepGradientContext); |
49 } | 50 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 str->appendScalar(fCenter.fX); | 266 str->appendScalar(fCenter.fX); |
266 str->append(", "); | 267 str->append(", "); |
267 str->appendScalar(fCenter.fY); | 268 str->appendScalar(fCenter.fY); |
268 str->append(") "); | 269 str->append(") "); |
269 | 270 |
270 this->INHERITED::toString(str); | 271 this->INHERITED::toString(str); |
271 | 272 |
272 str->append(")"); | 273 str->append(")"); |
273 } | 274 } |
274 #endif | 275 #endif |
OLD | NEW |