Index: src/core/SkBlitter.h |
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h |
index 42ef34249ad95b96fbee1a50bf4b6ddc5675d4fd..0e5fedd7ebb648668d663c22987c775aaa7ca390 100644 |
--- a/src/core/SkBlitter.h |
+++ b/src/core/SkBlitter.h |
@@ -22,6 +22,9 @@ struct SkMask; |
/** SkBlitter and its subclasses are responsible for actually writing pixels |
into memory. Besides efficiency, they handle clipping and antialiasing. |
+ A SkBlitter subclass contains all the context needed to generate pixels |
+ for the destination and how src/generated pixels map to the destination. |
+ The coordinates passed to the blitX calls are in destination pixel space. |
*/ |
class SkBlitter { |
public: |
@@ -32,6 +35,16 @@ public: |
/// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* |
/// zero-terminated run-length encoding of spans of constant alpha values. |
+ /// The runs[] and antialias[] work together to represent long runs of pixels with the same |
+ /// alphas. The runs[] contains the number of pixels with the same alpha, and antialias[] |
+ /// contain the coverage value for that number of pixels. The runs[] (and antialias[]) are |
+ /// encoded in a clever way. The runs array is zero terminated, and has enough entries for |
+ /// each pixel plus one, in most cases some of the entries will not contain valid data. An entry |
+ /// in the runs array contains the number of pixels (np) that have the same alpha value. The |
+ /// next np value is found np entries away. For example, if runs[0] = 7, then the next valid |
+ /// entry will by at runs[7]. The runs array and antialias[] are coupled by index. So, if the |
+ /// np entry is at runs[45] = 12 then the alpha value can be found at antialias[45] = 0x88. |
+ /// This would mean to use an alpha value of 0x88 for the next 12 pixels starting at pixel 45. |
virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) = 0; |
/// Blit a vertical run of pixels with a constant alpha value. |