Line-endings only change (some windows line-endings snuck in)
git-svn-id: http://skia.googlecode.com/svn/trunk@2588 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
910267dde2
commit
daba14b7d4
@ -105,35 +105,35 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* On success (returns true), copy the canvas pixels into the bitmap.
|
||||
* On failure, the bitmap parameter is left unchanged and false is
|
||||
* returned.
|
||||
*
|
||||
* If the canvas is backed by a non-raster device (e.g. PDF) then
|
||||
* readPixels will fail.
|
||||
*
|
||||
* If the bitmap has pixels already allocated, the canvas pixels will be
|
||||
* written there. If not, bitmap->allocPixels() will be called
|
||||
* automatically. If the bitmap is backed by a texture readPixels will
|
||||
* fail.
|
||||
*
|
||||
* The canvas' pixels are converted to the bitmap's config. The only
|
||||
* supported config is kARGB_8888_Config, though this may be relaxed in
|
||||
* future.
|
||||
*
|
||||
* The actual pixels written is the intersection of the canvas' bounds, and
|
||||
* the rectangle formed by the bitmap's width,height and the specified x,y.
|
||||
* If bitmap pixels extend outside of that intersection, they will not be
|
||||
* modified.
|
||||
*
|
||||
* Example that reads the entire canvas into a bitmap:
|
||||
* SkISize size = canvas->getDeviceSize();
|
||||
* bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
|
||||
* size.fHeight);
|
||||
* if (canvas->readPixels(bitmap, 0, 0)) {
|
||||
* // use the pixels
|
||||
* }
|
||||
/**
|
||||
* On success (returns true), copy the canvas pixels into the bitmap.
|
||||
* On failure, the bitmap parameter is left unchanged and false is
|
||||
* returned.
|
||||
*
|
||||
* If the canvas is backed by a non-raster device (e.g. PDF) then
|
||||
* readPixels will fail.
|
||||
*
|
||||
* If the bitmap has pixels already allocated, the canvas pixels will be
|
||||
* written there. If not, bitmap->allocPixels() will be called
|
||||
* automatically. If the bitmap is backed by a texture readPixels will
|
||||
* fail.
|
||||
*
|
||||
* The canvas' pixels are converted to the bitmap's config. The only
|
||||
* supported config is kARGB_8888_Config, though this may be relaxed in
|
||||
* future.
|
||||
*
|
||||
* The actual pixels written is the intersection of the canvas' bounds, and
|
||||
* the rectangle formed by the bitmap's width,height and the specified x,y.
|
||||
* If bitmap pixels extend outside of that intersection, they will not be
|
||||
* modified.
|
||||
*
|
||||
* Example that reads the entire canvas into a bitmap:
|
||||
* SkISize size = canvas->getDeviceSize();
|
||||
* bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
|
||||
* size.fHeight);
|
||||
* if (canvas->readPixels(bitmap, 0, 0)) {
|
||||
* // use the pixels
|
||||
* }
|
||||
*/
|
||||
bool readPixels(SkBitmap* bitmap, int x, int y);
|
||||
|
||||
|
@ -560,11 +560,11 @@ bool SkCanvas::readPixels(SkBitmap* bitmap, int x, int y) {
|
||||
|
||||
bool SkCanvas::readPixels(const SkIRect& srcRect, SkBitmap* bitmap) {
|
||||
SkDevice* device = this->getDevice();
|
||||
|
||||
SkIRect bounds;
|
||||
|
||||
SkIRect bounds;
|
||||
bounds.set(0, 0, device->width(), device->height());
|
||||
if (!bounds.intersect(srcRect)) {
|
||||
return false;
|
||||
if (!bounds.intersect(srcRect)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkBitmap tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user