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 "SkRadialGradient.h" | 8 #include "SkRadialGradient.h" |
9 #include "SkNx.h" | 9 #include "SkNx.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 return kRadial_GradientType; | 60 return kRadial_GradientType; |
61 } | 61 } |
62 | 62 |
63 sk_sp<SkFlattenable> SkRadialGradient::CreateProc(SkReadBuffer& buffer) { | 63 sk_sp<SkFlattenable> SkRadialGradient::CreateProc(SkReadBuffer& buffer) { |
64 DescriptorScope desc; | 64 DescriptorScope desc; |
65 if (!desc.unflatten(buffer)) { | 65 if (!desc.unflatten(buffer)) { |
66 return nullptr; | 66 return nullptr; |
67 } | 67 } |
68 const SkPoint center = buffer.readPoint(); | 68 const SkPoint center = buffer.readPoint(); |
69 const SkScalar radius = buffer.readScalar(); | 69 const SkScalar radius = buffer.readScalar(); |
70 return SkGradientShader::MakeRadial(center, radius, desc.fColors, desc.fPos,
desc.fCount, | 70 return SkGradientShader::MakeRadial(center, radius, desc.fColors, std::move(
desc.fColorSpace), |
71 desc.fTileMode, desc.fGradFlags, desc.fL
ocalMatrix); | 71 desc.fPos, desc.fCount, desc.fTileMode,
desc.fGradFlags, |
| 72 desc.fLocalMatrix); |
72 } | 73 } |
73 | 74 |
74 void SkRadialGradient::flatten(SkWriteBuffer& buffer) const { | 75 void SkRadialGradient::flatten(SkWriteBuffer& buffer) const { |
75 this->INHERITED::flatten(buffer); | 76 this->INHERITED::flatten(buffer); |
76 buffer.writePoint(fCenter); | 77 buffer.writePoint(fCenter); |
77 buffer.writeScalar(fRadius); | 78 buffer.writeScalar(fRadius); |
78 } | 79 } |
79 | 80 |
80 namespace { | 81 namespace { |
81 | 82 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 str->appendScalar(fCenter.fY); | 376 str->appendScalar(fCenter.fY); |
376 str->append(") radius: "); | 377 str->append(") radius: "); |
377 str->appendScalar(fRadius); | 378 str->appendScalar(fRadius); |
378 str->append(" "); | 379 str->append(" "); |
379 | 380 |
380 this->INHERITED::toString(str); | 381 this->INHERITED::toString(str); |
381 | 382 |
382 str->append(")"); | 383 str->append(")"); |
383 } | 384 } |
384 #endif | 385 #endif |
OLD | NEW |