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

Unified Diff: src/image/SkImage_Raster.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/SkImageShader.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 192a4e03eccbc2eed4ca54e23117f17b35bb2e73..645a3db64b31b97d981501d3b72c4ae544256294 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -254,7 +254,7 @@ sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
return sk_make_sp<SkImage_Raster>(info, pr, pixelRefOrigin, rowBytes);
}
-sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, ForceCopyMode forceCopy) {
+sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, SkCopyPixelsMode cpm) {
bool hasColorTable = false;
if (kIndex_8_SkColorType == bm.colorType()) {
SkAutoLockPixels autoLockPixels(bm);
@@ -266,9 +266,7 @@ sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, ForceCopyMode for
}
sk_sp<SkImage> image;
- if (kYes_ForceCopyMode == forceCopy ||
- (!bm.isImmutable() && kNever_ForceCopyMode != forceCopy))
- {
+ if (kAlways_SkCopyPixelsMode == cpm || (!bm.isImmutable() && kNever_SkCopyPixelsMode != cpm)) {
SkBitmap tmp(bm);
tmp.lockPixels();
SkPixmap pmap;
@@ -276,7 +274,7 @@ sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, ForceCopyMode for
image = SkImage::MakeRasterCopy(pmap);
}
} else {
- image = sk_make_sp<SkImage_Raster>(bm, kNever_ForceCopyMode == forceCopy);
+ image = sk_make_sp<SkImage_Raster>(bm, kNever_SkCopyPixelsMode == cpm);
}
return image;
}
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698