OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkSweepGradient.h" | 9 #include "SkSweepGradient.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 const SkPoint center = buffer.readPoint(); | 38 const SkPoint center = buffer.readPoint(); |
39 return SkGradientShader::CreateSweep(center.x(), center.y(), desc.fColors, d
esc.fPos, | 39 return SkGradientShader::CreateSweep(center.x(), center.y(), desc.fColors, d
esc.fPos, |
40 desc.fCount, desc.fGradFlags, desc.fLoc
alMatrix); | 40 desc.fCount, desc.fGradFlags, desc.fLoc
alMatrix); |
41 } | 41 } |
42 | 42 |
43 void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { | 43 void SkSweepGradient::flatten(SkWriteBuffer& buffer) const { |
44 this->INHERITED::flatten(buffer); | 44 this->INHERITED::flatten(buffer); |
45 buffer.writePoint(fCenter); | 45 buffer.writePoint(fCenter); |
46 } | 46 } |
47 | 47 |
48 size_t SkSweepGradient::contextSize() const { | 48 size_t SkSweepGradient::contextSize(const ContextRec&) const { |
49 return sizeof(SweepGradientContext); | 49 return sizeof(SweepGradientContext); |
50 } | 50 } |
51 | 51 |
52 SkShader::Context* SkSweepGradient::onCreateContext(const ContextRec& rec, void*
storage) const { | 52 SkShader::Context* SkSweepGradient::onCreateContext(const ContextRec& rec, void*
storage) const { |
53 return new (storage) SweepGradientContext(*this, rec); | 53 return new (storage) SweepGradientContext(*this, rec); |
54 } | 54 } |
55 | 55 |
56 SkSweepGradient::SweepGradientContext::SweepGradientContext( | 56 SkSweepGradient::SweepGradientContext::SweepGradientContext( |
57 const SkSweepGradient& shader, const ContextRec& rec) | 57 const SkSweepGradient& shader, const ContextRec& rec) |
58 : INHERITED(shader, rec) {} | 58 : INHERITED(shader, rec) {} |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 str->appendScalar(fCenter.fX); | 261 str->appendScalar(fCenter.fX); |
262 str->append(", "); | 262 str->append(", "); |
263 str->appendScalar(fCenter.fY); | 263 str->appendScalar(fCenter.fY); |
264 str->append(") "); | 264 str->append(") "); |
265 | 265 |
266 this->INHERITED::toString(str); | 266 this->INHERITED::toString(str); |
267 | 267 |
268 str->append(")"); | 268 str->append(")"); |
269 } | 269 } |
270 #endif | 270 #endif |
OLD | NEW |