add shader flag kConstInY_Flag
this signals blitters that the shader will return the same results for a given
x value, independent of y. Useful inside blitRect(), where it can cache the
first call to shadeSpan() and reuse it on all subsequent scans. Works with
(non-rotated) linear-gradients, and Nx1 bitmaps.
git-svn-id: http://skia.googlecode.com/svn/trunk@214 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 7c13e3d..8fac8cb 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -63,14 +63,22 @@
enum Flags {
//!< set if all of the colors will be opaque
kOpaqueAlpha_Flag = 0x01,
+
//! set if this shader's shadeSpan16() method can be called
kHasSpan16_Flag = 0x02,
+
/** Set this bit if the shader's native data type is instrinsically 16
bit, meaning that calling the 32bit shadeSpan() entry point will
mean the the impl has to up-sample 16bit data into 32bit. Used as a
a means of clearing a dither request if the it will have no effect
*/
- kIntrinsicly16_Flag = 0x04
+ kIntrinsicly16_Flag = 0x04,
+
+ /** set (after setContext) if the spans only vary in X (const in Y).
+ e.g. an Nx1 bitmap that is being tiled in Y, or a linear-gradient
+ that varies from left-to-right
+ */
+ kConstInY_Flag = 0x08
};
/** Called sometimes before drawing with this shader.