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 "Sk4fLinearGradient.h" | 8 #include "Sk4fLinearGradient.h" |
9 #include "SkLinearGradient.h" | 9 #include "SkLinearGradient.h" |
10 #include "SkRefCnt.h" | 10 #include "SkRefCnt.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 sk_sp<SkFlattenable> SkLinearGradient::CreateProc(SkReadBuffer& buffer) { | 58 sk_sp<SkFlattenable> SkLinearGradient::CreateProc(SkReadBuffer& buffer) { |
59 DescriptorScope desc; | 59 DescriptorScope desc; |
60 if (!desc.unflatten(buffer)) { | 60 if (!desc.unflatten(buffer)) { |
61 return nullptr; | 61 return nullptr; |
62 } | 62 } |
63 SkPoint pts[2]; | 63 SkPoint pts[2]; |
64 pts[0] = buffer.readPoint(); | 64 pts[0] = buffer.readPoint(); |
65 pts[1] = buffer.readPoint(); | 65 pts[1] = buffer.readPoint(); |
66 return SkGradientShader::MakeLinear(pts, desc.fColors, desc.fPos, desc.fCoun
t, desc.fTileMode, | 66 return SkGradientShader::MakeLinear(pts, desc.fColors, std::move(desc.fColor
Space), desc.fPos, |
67 desc.fGradFlags, desc.fLocalMatrix); | 67 desc.fCount, desc.fTileMode, desc.fGradF
lags, |
| 68 desc.fLocalMatrix); |
68 } | 69 } |
69 | 70 |
70 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { | 71 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { |
71 this->INHERITED::flatten(buffer); | 72 this->INHERITED::flatten(buffer); |
72 buffer.writePoint(fStart); | 73 buffer.writePoint(fStart); |
73 buffer.writePoint(fEnd); | 74 buffer.writePoint(fEnd); |
74 } | 75 } |
75 | 76 |
76 size_t SkLinearGradient::onContextSize(const ContextRec& rec) const { | 77 size_t SkLinearGradient::onContextSize(const ContextRec& rec) const { |
77 return use_4f_context(rec, fGradFlags) | 78 return use_4f_context(rec, fGradFlags) |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); | 759 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); |
759 } | 760 } |
760 } else { | 761 } else { |
761 if (fApplyAlphaAfterInterp) { | 762 if (fApplyAlphaAfterInterp) { |
762 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); | 763 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); |
763 } else { | 764 } else { |
764 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); | 765 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); |
765 } | 766 } |
766 } | 767 } |
767 } | 768 } |
OLD | NEW |