aboutsummaryrefslogtreecommitdiff
path: root/samplecode/SampleBitmapRect.cpp
diff options
context:
space:
mode:
authorwjmaclean@chromium.org <wjmaclean@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2010-11-16 20:22:41 +0000
committerwjmaclean@chromium.org <wjmaclean@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2010-11-16 20:22:41 +0000
commit86bff1f008308267c4ff75456b202a9cf60c6193 (patch)
treeb66ba1d5f68a43984fbb549905282802d4628169 /samplecode/SampleBitmapRect.cpp
parent28be72b63e457c680c192a34fb9f58e1c693363f (diff)
Add safe size/copy functions to Skia.
This patch adds four methods to SkBitmap. There are two functions to return "safe size", defined as the number of pixels from the value returned by getPixels() to the end of the allocated buffer. There is one version of fillPixels() to copy the bitmap instance into an external buffer (with specified size, and using specified stride), and another fillPixels() to copy from an external buffer to the instance bitmap. In the latter case the specified height, width and pixel format must match that used by the bitmap instance, although the specified stride may be any value at least as large as the minimum stride for the specified geometry. It is assumed that the external buffer is of size at least (height - 1)*stride + width * bytesPerPixel. Both fillPixels() functions return false if the copy is not possible with the specified parameters. Review URL: http://codereview.appspot.com/2837041/ git-svn-id: http://skia.googlecode.com/svn/trunk@625 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleBitmapRect.cpp')
0 files changed, 0 insertions, 0 deletions