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

Side by Side Diff: src/core/SkShader.cpp

Issue 1789443002: Revert "Revert of add Make variations to return SkImage by sk_sp (patchset #5 id:80001 of https://c… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use get, not release, when calling legacy function that wants ptr 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 | « src/core/SkReadBuffer.cpp ('k') | src/image/SkImage.cpp » ('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 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmapProcShader.h" 9 #include "SkBitmapProcShader.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 sk_sp<SkShader> SkShader::MakeEmptyShader() { return sk_make_sp<SkEmptyShader>() ; } 232 sk_sp<SkShader> SkShader::MakeEmptyShader() { return sk_make_sp<SkEmptyShader>() ; }
233 233
234 sk_sp<SkShader> SkShader::MakeColorShader(SkColor color) { return sk_make_sp<SkC olorShader>(color); } 234 sk_sp<SkShader> SkShader::MakeColorShader(SkColor color) { return sk_make_sp<SkC olorShader>(color); }
235 235
236 sk_sp<SkShader> SkShader::MakeBitmapShader(const SkBitmap& src, TileMode tmx, Ti leMode tmy, 236 sk_sp<SkShader> SkShader::MakeBitmapShader(const SkBitmap& src, TileMode tmx, Ti leMode tmy,
237 const SkMatrix* localMatrix) { 237 const SkMatrix* localMatrix) {
238 return SkMakeBitmapShader(src, tmx, tmy, localMatrix, nullptr); 238 return SkMakeBitmapShader(src, tmx, tmy, localMatrix, nullptr);
239 } 239 }
240 240
241 sk_sp<SkShader> SkShader::MakePictureShader(sk_sp<const SkPicture> src, TileMode tmx, TileMode tmy, 241 sk_sp<SkShader> SkShader::MakePictureShader(sk_sp<SkPicture> src, TileMode tmx, TileMode tmy,
242 const SkMatrix* localMatrix, const S kRect* tile) { 242 const SkMatrix* localMatrix, const S kRect* tile) {
243 return SkPictureShader::Make(std::move(src), tmx, tmy, localMatrix, tile); 243 return SkPictureShader::Make(std::move(src), tmx, tmy, localMatrix, tile);
244 } 244 }
245 245
246 #ifndef SK_IGNORE_TO_STRING 246 #ifndef SK_IGNORE_TO_STRING
247 void SkShader::toString(SkString* str) const { 247 void SkShader::toString(SkString* str) const {
248 if (!fLocalMatrix.isIdentity()) { 248 if (!fLocalMatrix.isIdentity()) {
249 str->append(" "); 249 str->append(" ");
250 fLocalMatrix.toString(str); 250 fLocalMatrix.toString(str);
251 } 251 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR 382 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
383 SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode ::Mode mode) { 383 SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode ::Mode mode) {
384 return MakeComposeShader(sk_ref_sp(dst), sk_ref_sp(src), mode).release(); 384 return MakeComposeShader(sk_ref_sp(dst), sk_ref_sp(src), mode).release();
385 } 385 }
386 SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode * xfer) { 386 SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode * xfer) {
387 return MakeComposeShader(sk_ref_sp(dst), sk_ref_sp(src), xfer).release(); 387 return MakeComposeShader(sk_ref_sp(dst), sk_ref_sp(src), xfer).release();
388 } 388 }
389 SkShader* SkShader::CreatePictureShader(const SkPicture* src, TileMode tmx, Tile Mode tmy, 389 SkShader* SkShader::CreatePictureShader(const SkPicture* src, TileMode tmx, Tile Mode tmy,
390 const SkMatrix* localMatrix, const SkRect* tile) { 390 const SkMatrix* localMatrix, const SkRect* tile) {
391 return MakePictureShader(sk_ref_sp(src), tmx, tmy, localMatrix, tile).releas e(); 391 return MakePictureShader(sk_ref_sp(const_cast<SkPicture*>(src)), tmx, tmy,
392 localMatrix, tile).release();
392 } 393 }
393 #endif 394 #endif
OLDNEW
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698