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/SkTwoPointRadialGradient.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 "SkTwoPointRadialGradient.h" 9 #include "SkTwoPointRadialGradient.h"
10 10
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 str->appendScalar(fRadius2); 327 str->appendScalar(fRadius2);
328 str->append(" "); 328 str->append(" ");
329 329
330 this->INHERITED::toString(str); 330 this->INHERITED::toString(str);
331 331
332 str->append(")"); 332 str->append(")");
333 } 333 }
334 #endif 334 #endif
335 335
336 SkTwoPointRadialGradient::SkTwoPointRadialGradient( 336 SkTwoPointRadialGradient::SkTwoPointRadialGradient(
337 SkFlattenableReadBuffer& buffer) 337 SkReadBuffer& buffer)
338 : INHERITED(buffer), 338 : INHERITED(buffer),
339 fCenter1(buffer.readPoint()), 339 fCenter1(buffer.readPoint()),
340 fCenter2(buffer.readPoint()), 340 fCenter2(buffer.readPoint()),
341 fRadius1(buffer.readScalar()), 341 fRadius1(buffer.readScalar()),
342 fRadius2(buffer.readScalar()) { 342 fRadius2(buffer.readScalar()) {
343 init(); 343 init();
344 }; 344 };
345 345
346 void SkTwoPointRadialGradient::flatten( 346 void SkTwoPointRadialGradient::flatten(
347 SkFlattenableWriteBuffer& buffer) const { 347 SkWriteBuffer& buffer) const {
348 this->INHERITED::flatten(buffer); 348 this->INHERITED::flatten(buffer);
349 buffer.writePoint(fCenter1); 349 buffer.writePoint(fCenter1);
350 buffer.writePoint(fCenter2); 350 buffer.writePoint(fCenter2);
351 buffer.writeScalar(fRadius1); 351 buffer.writeScalar(fRadius1);
352 buffer.writeScalar(fRadius2); 352 buffer.writeScalar(fRadius2);
353 } 353 }
354 354
355 void SkTwoPointRadialGradient::init() { 355 void SkTwoPointRadialGradient::init() {
356 fDiff = fCenter1 - fCenter2; 356 fDiff = fCenter1 - fCenter2;
357 fDiffRadius = fRadius2 - fRadius1; 357 fDiffRadius = fRadius2 - fRadius1;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 } 682 }
683 683
684 #else 684 #else
685 685
686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst { 686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst {
687 SkDEBUGFAIL("Should not call in GPU-less build"); 687 SkDEBUGFAIL("Should not call in GPU-less build");
688 return NULL; 688 return NULL;
689 } 689 }
690 690
691 #endif 691 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698