Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 134163010: Refactor read and write buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: original write flags were fine Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const { 233 SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const {
234 if (info) { 234 if (info) {
235 commonAsAGradient(info); 235 commonAsAGradient(info);
236 info->fPoint[0] = fCenter; 236 info->fPoint[0] = fCenter;
237 info->fRadius[0] = fRadius; 237 info->fRadius[0] = fRadius;
238 } 238 }
239 return kRadial_GradientType; 239 return kRadial_GradientType;
240 } 240 }
241 241
242 SkRadialGradient::SkRadialGradient(SkFlattenableReadBuffer& buffer) 242 SkRadialGradient::SkRadialGradient(SkReadBuffer& buffer)
243 : INHERITED(buffer), 243 : INHERITED(buffer),
244 fCenter(buffer.readPoint()), 244 fCenter(buffer.readPoint()),
245 fRadius(buffer.readScalar()) { 245 fRadius(buffer.readScalar()) {
246 } 246 }
247 247
248 void SkRadialGradient::flatten(SkFlattenableWriteBuffer& buffer) const { 248 void SkRadialGradient::flatten(SkWriteBuffer& buffer) const {
249 this->INHERITED::flatten(buffer); 249 this->INHERITED::flatten(buffer);
250 buffer.writePoint(fCenter); 250 buffer.writePoint(fCenter);
251 buffer.writeScalar(fRadius); 251 buffer.writeScalar(fRadius);
252 } 252 }
253 253
254 namespace { 254 namespace {
255 255
256 inline bool radial_completely_pinned(int fx, int dx, int fy, int dy) { 256 inline bool radial_completely_pinned(int fx, int dx, int fy, int dy) {
257 // fast, overly-conservative test: checks unit square instead 257 // fast, overly-conservative test: checks unit square instead
258 // of unit circle 258 // of unit circle
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 str->appendScalar(fCenter.fY); 573 str->appendScalar(fCenter.fY);
574 str->append(") radius: "); 574 str->append(") radius: ");
575 str->appendScalar(fRadius); 575 str->appendScalar(fRadius);
576 str->append(" "); 576 str->append(" ");
577 577
578 this->INHERITED::toString(str); 578 this->INHERITED::toString(str);
579 579
580 str->append(")"); 580 str->append(")");
581 } 581 }
582 #endif 582 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698