diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-09-10 10:40:43 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-09-10 10:40:43 +0100 |
commit | 90b3f9b82dbad266f960601d2120082bb841fb97 (patch) | |
tree | 9fac7d0d99f3588bca436bcef37c8a1b8e9d3647 /include/core/SkBitmap.h | |
parent | e90b557be8fb14d632e6243bf7c4efc9286740e3 (diff) | |
parent | 89ba1591e2b376b0315e5613ab62f22fbf3ed7ac (diff) | |
download | skia-l-preview.tar.gz |
Merge from Chromium at DEPS revision 37.0.2062.117android-wear-5.0.0_r1android-l-preview_r2android-cts-5.0_r9android-cts-5.0_r8android-cts-5.0_r7android-cts-5.0_r6android-cts-5.0_r5android-cts-5.0_r4android-cts-5.0_r3android-5.0.2_r3android-5.0.2_r1android-5.0.1_r1android-5.0.0_r7android-5.0.0_r6android-5.0.0_r5.1android-5.0.0_r5android-5.0.0_r4android-5.0.0_r3android-5.0.0_r2android-5.0.0_r1lollipop-wear-releaselollipop-releaselollipop-devlollipop-cts-releasel-preview
This commit was generated by merge_to_master.py.
Change-Id: I9cd955d97932b42739ee7e6abb42e1f05d514410
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r-- | include/core/SkBitmap.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index d3c33a8e0..13e9aa372 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -643,6 +643,28 @@ 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. */ |