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

Unified Diff: src/core/SkImagePriv.h

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/core/SkDraw.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImagePriv.h
diff --git a/src/image/SkImagePriv.h b/src/core/SkImagePriv.h
similarity index 85%
rename from src/image/SkImagePriv.h
rename to src/core/SkImagePriv.h
index 9cdcbb6f937681ff7aa178983e9722901f9d6de6..ed40996acd0a1e31e5e3a547961011382df738d9 100644
--- a/src/image/SkImagePriv.h
+++ b/src/core/SkImagePriv.h
@@ -16,12 +16,18 @@ extern sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo&, SkPixelRef*,
const SkIPoint& pixelRefOrigin,
size_t rowBytes);
+enum SkCopyPixelsMode {
+ kIfMutable_SkCopyPixelsMode, //!< only copy src pixels if they are marked mutable
+ kAlways_SkCopyPixelsMode, //!< always copy src pixels (even if they are marked immutable)
+ kNever_SkCopyPixelsMode, //!< never copy src pixels (even if they are marked mutable)
+};
+
/**
* Examines the bitmap to decide if it can share the existing pixelRef, or
* if it needs to make a deep-copy of the pixels.
*
* The bitmap's pixelref will be shared if either the bitmap is marked as
- * immutable, or forceSharePixelRef is true. Shared pixel refs are also
+ * immutable, or CopyPixelsMode allows it. Shared pixel refs are also
* locked when kLocked_SharedPixelRefMode is specified.
*
* Passing kLocked_SharedPixelRefMode allows the image's peekPixels() method
@@ -34,13 +40,7 @@ extern sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo&, SkPixelRef*,
* SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
* nullptr.
*/
-enum ForceCopyMode {
- kNo_ForceCopyMode,
- kYes_ForceCopyMode, // must copy the pixels even if the bitmap is immutable
- kNever_ForceCopyMode, // don't ever copy, even if the bitmap is mutable
-};
-extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&,
- ForceCopyMode = kNo_ForceCopyMode);
+extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, SkCopyPixelsMode);
// Given an image created from SkNewImageFromBitmap, return its pixelref. This
// may be called to see if the surface and the image share the same pixelref,
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698