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

Unified Diff: src/image/SkImageShader.cpp

Issue 2220603002: rename FoceCopyMode to SkCopyPixelMode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: manual rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImagePriv.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index a486f71dfde21365f54db34b6619be9b2508ebaf..5fbb0a9b9f0ba495d2fb32446dcc44b7cf0297a1 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -234,9 +234,14 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& ar
sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
SkShader::TileMode tmy, const SkMatrix* localMatrix,
- SkTBlitterAllocator* allocator) {
- ForceCopyMode mode = allocator ? kNever_ForceCopyMode : kNo_ForceCopyMode;
- return SkImageShader::Make(SkMakeImageFromRasterBitmap(src, mode).get(),
+ SkCopyPixelsMode cpm, SkTBlitterAllocator* allocator) {
+ // Until we learn otherwise, it seems that any caller that is passing an allocator must be
+ // assuming that the returned shader will have a stack-frame lifetime, so we assert that
+ // they are also asking for kNever_SkCopyPixelsMode. If that proves otherwise, we can remove
+ // or modify this assert.
+ SkASSERT(!allocator || (kNever_SkCopyPixelsMode == cpm));
+
+ return SkImageShader::Make(SkMakeImageFromRasterBitmap(src, cpm).get(),
tmx, tmy, localMatrix, allocator);
}
« no previous file with comments | « src/image/SkImagePriv.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698