diff options
author | 2014-07-11 07:48:20 -0700 | |
---|---|---|
committer | 2014-07-11 07:48:20 -0700 | |
commit | d08cb905a7cc80d8fb868bbd14fffe1cd68adcce (patch) | |
tree | 6f562c3fe22e3eb8eb45569fbfca025f57fc5fdb /include/core | |
parent | d081cf661ab418cb0d516a28e571282102691923 (diff) |
Revert of add readPixels() to SkBitmap (https://codereview.chromium.org/377303002/)
Reason for revert:
Maybe causing crashes in bench.
http://108.170.220.120:10117/builders/Test-ChromeOS-Daisy-MaliT604-Arm7-Debug/builds/2608/steps/RunBench/logs/stdio
Original issue's description:
> add readPixels() to SkBitmap
>
> BUG=chromium:390782
>
> Committed: https://skia.googlesource.com/skia/+/c4f216151b6ade70c35fade09a353052f40236b1
R=scroggo@google.com, bsalomon@google.com, reed@google.com
TBR=bsalomon@google.com, reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=chromium:390782
Author: jcgregorio@google.com
Review URL: https://codereview.chromium.org/382243003
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkBitmap.h | 22 | ||||
-rw-r--r-- | include/core/SkCanvas.h | 21 |
2 files changed, 10 insertions, 33 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 541db79bb3..51e9a9243a 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -591,28 +591,6 @@ public: } /** - * Copy the bitmap's pixels into the specified buffer (pixels + rowBytes), - * converting them into the requested format (SkImageInfo). The src pixels are read - * starting at the specified (srcX,srcY) offset, relative to the top-left corner. - * - * The specified ImageInfo and (srcX,srcY) offset specifies a source rectangle - * - * srcR.setXYWH(srcX, srcY, dstInfo.width(), dstInfo.height()); - * - * srcR is intersected with the bounds of the bitmap. If this intersection is not empty, - * then we have two sets of pixels (of equal size). Replace the dst pixels with the - * corresponding src pixels, performing any colortype/alphatype transformations needed - * (in the case where the src and dst have different colortypes or alphatypes). - * - * This call can fail, returning false, for several reasons: - * - If srcR does not intersect the bitmap bounds. - * - If the requested colortype/alphatype cannot be converted from the src's types. - * - If the src pixels are not available. - */ - bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, - int srcX, int srcY) const; - - /** * Returns true if this bitmap's pixels can be converted into the requested * colorType, such that copyTo() could succeed. */ diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 6bd3cc5363..424c12dbf3 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -234,31 +234,30 @@ public: /** * Copy the pixels from the base-layer into the specified buffer (pixels + rowBytes), * converting them into the requested format (SkImageInfo). The base-layer pixels are read - * starting at the specified (srcX,srcY) location in the coordinate system of the base-layer. + * starting at the specified (x,y) location in the coordinate system of the base-layer. * - * The specified ImageInfo and (srcX,srcY) offset specifies a source rectangle + * The specified ImageInfo and (x,y) offset specifies a source rectangle * - * srcR.setXYWH(srcX, srcY, dstInfo.width(), dstInfo.height()); + * srcR(x, y, info.width(), info.height()); * - * srcR is intersected with the bounds of the base-layer. If this intersection is not empty, - * then we have two sets of pixels (of equal size). Replace the dst pixels with the - * corresponding src pixels, performing any colortype/alphatype transformations needed - * (in the case where the src and dst have different colortypes or alphatypes). + * SrcR is intersected with the bounds of the base-layer. If this intersection is not empty, + * then we have two sets of pixels (of equal size), the "src" specified by base-layer at (x,y) + * and the "dst" by info+pixels+rowBytes. Replace the dst pixels with the corresponding src + * pixels, performing any colortype/alphatype transformations needed (in the case where the + * src and dst have different colortypes or alphatypes). * * This call can fail, returning false, for several reasons: - * - If srcR does not intersect the base-layer bounds. * - If the requested colortype/alphatype cannot be converted from the base-layer's types. * - If this canvas is not backed by pixels (e.g. picture or PDF) */ - bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, - int srcX, int srcY); + bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, int y); /** * Helper for calling readPixels(info, ...). This call will check if bitmap has been allocated. * If not, it will attempt to call allocPixels(). If this fails, it will return false. If not, * it calls through to readPixels(info, ...) and returns its result. */ - bool readPixels(SkBitmap* bitmap, int srcX, int srcY); + bool readPixels(SkBitmap* bitmap, int x, int y); /** * Helper for allocating pixels and then calling readPixels(info, ...). The bitmap is resized |