diff options
author | Matt Sarett <msarett@google.com> | 2017-04-27 12:45:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-27 17:18:03 +0000 |
commit | d4a338f4d0a0cdc08d7d3668931c60997f0fa971 (patch) | |
tree | 676fe5dcd3d19c14c5bf091243cadea35ebef205 /include/core/SkBitmap.h | |
parent | 9fa99614ec4e695f6e7e9fe19508758757543b8c (diff) |
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>
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r-- | include/core/SkBitmap.h | 51 |
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 */ |