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

Side by Side Diff: include/core/SkShader.h

Issue 1825073002: Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove flag 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
« no previous file with comments | « include/core/SkPaint.h ('k') | include/effects/SkBlurDrawLooper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #ifndef SkShader_DEFINED 8 #ifndef SkShader_DEFINED
9 #define SkShader_DEFINED 9 #define SkShader_DEFINED
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 /** 352 /**
353 * Return a shader that will apply the specified localMatrix to this shader . 353 * Return a shader that will apply the specified localMatrix to this shader .
354 * The specified matrix will be applied before any matrix associated with t his shader. 354 * The specified matrix will be applied before any matrix associated with t his shader.
355 */ 355 */
356 sk_sp<SkShader> makeWithLocalMatrix(const SkMatrix&) const; 356 sk_sp<SkShader> makeWithLocalMatrix(const SkMatrix&) const;
357 357
358 /** 358 /**
359 * Create a new shader that produces the same colors as invoking this shade r and then applying 359 * Create a new shader that produces the same colors as invoking this shade r and then applying
360 * the colorfilter. 360 * the colorfilter.
361 */ 361 */
362 sk_sp<SkShader> makeWithColorFilter(SkColorFilter*) const; 362 sk_sp<SkShader> makeWithColorFilter(sk_sp<SkColorFilter>) const;
363 363
364 ////////////////////////////////////////////////////////////////////////// 364 //////////////////////////////////////////////////////////////////////////
365 // Factory methods for stock shaders 365 // Factory methods for stock shaders
366 366
367 /** 367 /**
368 * Call this to create a new "empty" shader, that will not draw anything. 368 * Call this to create a new "empty" shader, that will not draw anything.
369 */ 369 */
370 static sk_sp<SkShader> MakeEmptyShader(); 370 static sk_sp<SkShader> MakeEmptyShader();
371 371
372 /** 372 /**
(...skipping 13 matching lines...) Expand all
386 return MakeBitmapShader(src, tmx, tmy, localMatrix).release(); 386 return MakeBitmapShader(src, tmx, tmy, localMatrix).release();
387 } 387 }
388 static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermod e::Mode mode); 388 static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermod e::Mode mode);
389 static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermod e* xfer); 389 static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermod e* xfer);
390 static SkShader* CreatePictureShader(const SkPicture* src, TileMode tmx, Til eMode tmy, 390 static SkShader* CreatePictureShader(const SkPicture* src, TileMode tmx, Til eMode tmy,
391 const SkMatrix* localMatrix, const SkRe ct* tile); 391 const SkMatrix* localMatrix, const SkRe ct* tile);
392 392
393 SkShader* newWithLocalMatrix(const SkMatrix& matrix) const { 393 SkShader* newWithLocalMatrix(const SkMatrix& matrix) const {
394 return this->makeWithLocalMatrix(matrix).release(); 394 return this->makeWithLocalMatrix(matrix).release();
395 } 395 }
396 SkShader* newWithColorFilter(SkColorFilter* filter) const { 396 SkShader* newWithColorFilter(SkColorFilter* filter) const;
397 return this->makeWithColorFilter(filter).release();
398 }
399 #endif 397 #endif
400 398
401 /** 399 /**
402 * Create a new compose shader, given shaders dst, src, and a combining xfe rmode mode. 400 * Create a new compose shader, given shaders dst, src, and a combining xfe rmode mode.
403 * The xfermode is called with the output of the two shaders, and its outpu t is returned. 401 * The xfermode is called with the output of the two shaders, and its outpu t is returned.
404 * If xfer is null, SkXfermode::kSrcOver_Mode is assumed. 402 * If xfer is null, SkXfermode::kSrcOver_Mode is assumed.
405 * 403 *
406 * The caller is responsible for managing its reference-count for the xfer (if not null). 404 * The caller is responsible for managing its reference-count for the xfer (if not null).
407 */ 405 */
408 static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader > src, 406 static sk_sp<SkShader> MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader > src,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 SkMatrix fLocalMatrix; 485 SkMatrix fLocalMatrix;
488 486
489 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. 487 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor.
490 friend class SkLocalMatrixShader; 488 friend class SkLocalMatrixShader;
491 friend class SkBitmapProcShader; // for computeTotalInverse() 489 friend class SkBitmapProcShader; // for computeTotalInverse()
492 490
493 typedef SkFlattenable INHERITED; 491 typedef SkFlattenable INHERITED;
494 }; 492 };
495 493
496 #endif 494 #endif
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | include/effects/SkBlurDrawLooper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698