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

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

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: partial update of skia call-sites Created 4 years, 9 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 * 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 "SkTwoPointConicalGradient.h" 8 #include "SkTwoPointConicalGradient.h"
9 #include "SkTwoPointConicalGradient_gpu.h" 9 #include "SkTwoPointConicalGradient_gpu.h"
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 pos[last - i] = SK_Scalar1 - tmp; 331 pos[last - i] = SK_Scalar1 - tmp;
332 } 332 }
333 } 333 }
334 if (pos) { 334 if (pos) {
335 if (desc.fCount & 1) { 335 if (desc.fCount & 1) {
336 pos[half] = SK_Scalar1 - pos[half]; 336 pos[half] = SK_Scalar1 - pos[half];
337 } 337 }
338 } 338 }
339 } 339 }
340 340
341 return SkGradientShader::CreateTwoPointConical(c1, r1, c2, r2, desc.fColors, desc.fPos, 341 return SkGradientShader::MakeTwoPointConical(c1, r1, c2, r2, desc.fColors, d esc.fPos,
342 desc.fCount, desc.fTileMode, desc.fGradFlags, 342 desc.fCount, desc.fTileMode, de sc.fGradFlags,
343 desc.fLocalMatrix); 343 desc.fLocalMatrix).release();
344 } 344 }
345 345
346 void SkTwoPointConicalGradient::flatten(SkWriteBuffer& buffer) const { 346 void SkTwoPointConicalGradient::flatten(SkWriteBuffer& buffer) const {
347 this->INHERITED::flatten(buffer); 347 this->INHERITED::flatten(buffer);
348 buffer.writePoint(fCenter1); 348 buffer.writePoint(fCenter1);
349 buffer.writePoint(fCenter2); 349 buffer.writePoint(fCenter2);
350 buffer.writeScalar(fRadius1); 350 buffer.writeScalar(fRadius1);
351 buffer.writeScalar(fRadius2); 351 buffer.writeScalar(fRadius2);
352 buffer.writeBool(fFlippedGrad); 352 buffer.writeBool(fFlippedGrad);
353 } 353 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 str->appendScalar(fCenter2.fY); 388 str->appendScalar(fCenter2.fY);
389 str->append(") radius2: "); 389 str->append(") radius2: ");
390 str->appendScalar(fRadius2); 390 str->appendScalar(fRadius2);
391 str->append(" "); 391 str->append(" ");
392 392
393 this->INHERITED::toString(str); 393 this->INHERITED::toString(str);
394 394
395 str->append(")"); 395 str->append(")");
396 } 396 }
397 #endif 397 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698