| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return SkGradientShader::CreateLinear(pts, desc.fColors, desc.fPos, desc.fCo
unt, | 74 return SkGradientShader::CreateLinear(pts, desc.fColors, desc.fPos, desc.fCo
unt, |
| 75 desc.fTileMode, desc.fGradFlags, desc.
fLocalMatrix); | 75 desc.fTileMode, desc.fGradFlags, desc.
fLocalMatrix); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { | 78 void SkLinearGradient::flatten(SkWriteBuffer& buffer) const { |
| 79 this->INHERITED::flatten(buffer); | 79 this->INHERITED::flatten(buffer); |
| 80 buffer.writePoint(fStart); | 80 buffer.writePoint(fStart); |
| 81 buffer.writePoint(fEnd); | 81 buffer.writePoint(fEnd); |
| 82 } | 82 } |
| 83 | 83 |
| 84 size_t SkLinearGradient::contextSize() const { | 84 size_t SkLinearGradient::contextSize(const ContextRec&) const { |
| 85 return use_4f_context(fGradFlags) | 85 return use_4f_context(fGradFlags) |
| 86 ? sizeof(LinearGradient4fContext) | 86 ? sizeof(LinearGradient4fContext) |
| 87 : sizeof(LinearGradientContext); | 87 : sizeof(LinearGradientContext); |
| 88 } | 88 } |
| 89 | 89 |
| 90 SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void
* storage) const { | 90 SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void
* storage) const { |
| 91 return use_4f_context(fGradFlags) | 91 return use_4f_context(fGradFlags) |
| 92 ? static_cast<SkShader::Context*>(new (storage) LinearGradient4fContext(
*this, rec)) | 92 ? static_cast<SkShader::Context*>(new (storage) LinearGradient4fContext(
*this, rec)) |
| 93 : static_cast<SkShader::Context*>(new (storage) LinearGradientContext(*t
his, rec)); | 93 : static_cast<SkShader::Context*>(new (storage) LinearGradientContext(*t
his, rec)); |
| 94 } | 94 } |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); | 755 this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
r); |
| 756 } | 756 } |
| 757 } else { | 757 } else { |
| 758 if (fApplyAlphaAfterInterp) { | 758 if (fApplyAlphaAfterInterp) { |
| 759 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); | 759 this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
r); |
| 760 } else { | 760 } else { |
| 761 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); | 761 this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
er); |
| 762 } | 762 } |
| 763 } | 763 } |
| 764 } | 764 } |
| OLD | NEW |