aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-02 18:55:44 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-02 18:55:44 +0000
commit5bdfb331ac650cf464baa96a49e2473ee10a515c (patch)
treeffd328cfee5da4bc5fb29be5af06ed97e69086d0 /include
parentce3d223cfe1b9dbb694dba6b8826b1fb187e667f (diff)
Detect color masks, and divert to draw-sprite instead of maskblitters.
Review URL: https://codereview.chromium.org/14637007 git-svn-id: http://skia.googlecode.com/svn/trunk@8967 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkMask.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/core/SkMask.h b/include/core/SkMask.h
index 4265595f26..4cf3ae7307 100644
--- a/include/core/SkMask.h
+++ b/include/core/SkMask.h
@@ -98,7 +98,20 @@ struct SkMask {
uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
return row + (x - fBounds.fLeft);
}
-
+
+ /**
+ * Return the address of the specified 32bit mask. In the debug build,
+ * this asserts that the mask's format is 32bits, and that (x,y)
+ * are contained in the mask's fBounds.
+ */
+ uint32_t* getAddr32(int x, int y) const {
+ SkASSERT(kLCD32_Format == fFormat || kARGB32_Format == fFormat);
+ SkASSERT(fBounds.contains(x, y));
+ SkASSERT(fImage != NULL);
+ uint32_t* row = (uint32_t*)(fImage + (y - fBounds.fTop) * fRowBytes);
+ 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