aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkBitmap.h
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-28 11:15:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-28 15:49:04 +0000
commit68b8e3d50d0954eb5eeb7f625f06026c7fbd38c1 (patch)
tree3bfd232ad1dab38ea06fffdd761ea24d016be337 /include/core/SkBitmap.h
parent0acd7954a9e654d7e9c11a532eeeeb2f18a76152 (diff)
Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag""
This reverts commit 0122af08f6af0dee490e1a4f35b552377d0d4753. Reason for revert: Fixed Android callsite Original change's description: > Revert "Delete copyTo(Allocator), hide copyTo() behind flag" > > This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971. > > Reason for revert: Looks like I missed something I was supposed to delete in Android. > > Original change's description: > > Delete copyTo(Allocator), hide copyTo() behind flag > > > > Replace uses of copyTo() in Skia. > > > > Bug: skia:6464 > > Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 > > Reviewed-on: https://skia-review.googlesource.com/14502 > > Commit-Queue: Matt Sarett <msarett@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > > > TBR=msarett@google.com,reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e > Reviewed-on: https://skia-review.googlesource.com/14602 > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,reviews@skia.org,reed@google.com Change-Id: I81659a820f79f1958fda23cb62513065b57db99d Reviewed-on: https://skia-review.googlesource.com/14640 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r--include/core/SkBitmap.h51
1 files changed, 7 insertions, 44 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 8818829a41..d38898ccef 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -552,39 +552,15 @@ public:
*/
bool extractSubset(SkBitmap* dst, const SkIRect& subset) const;
-#ifdef SK_BUILD_FOR_ANDROID
- /** Makes a deep copy of this bitmap, respecting the requested colorType,
- * and allocating the dst pixels on the cpu.
- * Returns false if either there is an error (i.e. the src does not have
- * pixels) or the request cannot be satisfied (e.g. the src has per-pixel
- * alpha, and the requested colortype does not support alpha).
- * @param dst The bitmap to be sized and allocated
- * @param ct The desired colorType for dst
- * @param allocator Allocator used to allocate the pixelref for the dst
- * bitmap. If this is null, the standard HeapAllocator
- * will be used.
- * @return true if the copy was made.
- */
- bool copyTo(SkBitmap* dst, SkColorType ct, Allocator*) const;
-
- bool copyTo(SkBitmap* dst, Allocator* allocator) const {
- return this->copyTo(dst, this->colorType(), allocator);
- }
-#endif
-
- /** Makes a deep copy of this bitmap, respecting the requested colorType.
- * Returns false if either there is an error (i.e. the src does not have
- * pixels) or the request cannot be satisfied (e.g. the src has per-pixel
- * alpha, and the requested colortype does not support alpha).
- * @param dst The bitmap to be sized and allocated
- * @param ct The desired colorType for dst
- * @return true if the copy was made.
- */
+#ifdef SK_SUPPORT_LEGACY_BITMAP_COPYTO
bool copyTo(SkBitmap* dst, SkColorType ct) const;
-
bool copyTo(SkBitmap* dst) const {
return this->copyTo(dst, this->colorType());
}
+ bool deepCopyTo(SkBitmap* dst) const {
+ return this->copyTo(dst, this->colorType());
+ }
+#endif
/**
* Copy the bitmap's pixels into the specified buffer (pixels + rowBytes),
@@ -625,20 +601,6 @@ public:
return this->writePixels(src, 0, 0);
}
- /**
- * Returns true if this bitmap's pixels can be converted into the requested
- * colorType, such that copyTo() could succeed.
- */
- bool canCopyTo(SkColorType colorType) const;
-
- /** Makes a deep copy of this bitmap, keeping the copied pixels
- * in the same domain as the source: If the src pixels are allocated for
- * the cpu, then so will the dst. If the src pixels are allocated on the
- * gpu (typically as a texture), the it will do the same for the dst.
- * If the request cannot be fulfilled, returns false and dst is unmodified.
- */
- bool deepCopyTo(SkBitmap* dst) const;
-
#ifdef SK_BUILD_FOR_ANDROID
bool hasHardwareMipMap() const {
return (fFlags & kHasHardwareMipMap_Flag) != 0;
@@ -736,7 +698,8 @@ private:
uint8_t fFlags;
bool writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior);
- bool internalCopyTo(SkBitmap* dst, SkColorType ct, Allocator*) const;
+
+ bool canCopyTo(SkColorType colorType) const;
/* Unreference any pixelrefs or colortables
*/