| 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 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 SkPoint pts[2]; | 62 SkPoint pts[2]; |
| 63 pts[0] = buffer.readPoint(); | 63 pts[0] = buffer.readPoint(); |
| 64 pts[1] = buffer.readPoint(); | 64 pts[1] = buffer.readPoint(); |
| 65 return SkGradientShader::MakeLinear(pts, desc.fColors, desc.fPos, desc.fCoun
t, desc.fTileMode, | 65 return SkGradientShader::MakeLinear(pts, desc.fColors, desc.fPos, desc.fCoun
t, desc.fTileMode, |
| 66 desc.fGradFlags, desc.fLocalMatrix); | 66 desc.fGradFlags, desc.fLocalMatrix); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { | 69 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { |
| 70 this->INHERITED::flatten(buffer); | 70 this->INHERITED::flatten(buffer); |
| 71 buffer.writePoint(fStart); | 71 buffer.writePoint("fStart", fStart); |
| 72 buffer.writePoint(fEnd); | 72 buffer.writePoint("fEnd", fEnd); |
| 73 } | 73 } |
| 74 | 74 |
| 75 size_t SkLinearGradient::onContextSize(const ContextRec& rec) const { | 75 size_t SkLinearGradient::onContextSize(const ContextRec& rec) const { |
| 76 return use_4f_context(rec, fGradFlags) | 76 return use_4f_context(rec, fGradFlags) |
| 77 ? sizeof(LinearGradient4fContext) | 77 ? sizeof(LinearGradient4fContext) |
| 78 : sizeof(LinearGradientContext); | 78 : sizeof(LinearGradientContext); |
| 79 } | 79 } |
| 80 | 80 |
| 81 SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void
* storage) const { | 81 SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void
* storage) const { |
| 82 return use_4f_context(rec, fGradFlags) | 82 return use_4f_context(rec, fGradFlags) |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); | 744 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); |
| 745 } | 745 } |
| 746 } else { | 746 } else { |
| 747 if (fApplyAlphaAfterInterp) { | 747 if (fApplyAlphaAfterInterp) { |
| 748 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); | 748 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); |
| 749 } else { | 749 } else { |
| 750 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); | 750 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); |
| 751 } | 751 } |
| 752 } | 752 } |
| 753 } | 753 } |
| OLD | NEW |