diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-18 17:29:44 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-18 17:29:44 +0000 |
commit | f52e55543e8e34a9fc9dd6f6f2d0e14e25d97ba5 (patch) | |
tree | 51f136c4dec07156ebc372762df4c8db97b14562 /include | |
parent | 7989186dab6bc2f1c1927daf91bddd32b7fd8d0c (diff) |
(re)add SkMask::getAddr() which now checks its pixel-size at runtime.
git-svn-id: http://skia.googlecode.com/svn/trunk@2488 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMask.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkMask.h b/include/core/SkMask.h index 8e3fd2b66e..1af78e159c 100644 --- a/include/core/SkMask.h +++ b/include/core/SkMask.h @@ -99,6 +99,20 @@ struct SkMask { return row + (x - fBounds.fLeft); } + /** + * Returns the address of the specified pixel, computing the pixel-size + * at runtime based on the mask format. This will be slightly slower than + * using one of the routines where the format is implied by the name + * e.g. getAddr8 or getAddrLCD32. + * + * x,y must be contained by the mask's bounds (this is asserted in the + * debug build, but not checked in the release build.) + * + * This should not be called with kBW_Format, as it will give unspecified + * results (and assert in the debug build). + */ + void* getAddr(int x, int y) const; + static uint8_t* AllocImage(size_t bytes); static void FreeImage(void* image); |