Index: src/images/SkScaledBitmapSampler.h |
diff --git a/src/images/SkScaledBitmapSampler.h b/src/images/SkScaledBitmapSampler.h |
index a293fe7ebb728d2ea88d1f95fbc3f5f341231042..e6c4577174c3551afbdf1b228b658d1b668113fe 100644 |
--- a/src/images/SkScaledBitmapSampler.h |
+++ b/src/images/SkScaledBitmapSampler.h |
@@ -22,6 +22,7 @@ public: |
int scaledHeight() const { return fScaledHeight; } |
int srcY0() const { return fY0; } |
+ int srcDX() const { return fDX; } |
int srcDY() const { return fDY; } |
enum SrcConfig { |
@@ -42,6 +43,12 @@ public: |
// returns true if the row had non-opaque alpha in it |
bool next(const uint8_t* SK_RESTRICT src); |
+ // Like next(), but specifies the y value of the source row, so the |
+ // rows can come in any order. If the row is not part of the output |
+ // sample, it will be skipped. Only sampleInterlaced OR next should |
+ // be called for one SkScaledBitmapSampler. |
+ bool sampleInterlaced(const uint8_t* SK_RESTRICT src, int srcY); |
+ |
typedef bool (*RowProc)(void* SK_RESTRICT dstRow, |
const uint8_t* SK_RESTRICT src, |
int width, int deltaSrc, int y, |
@@ -56,6 +63,18 @@ private: |
int fDX; // step between X samples |
int fDY; // step between Y samples |
+#ifdef SK_DEBUG |
+ // Keep track of whether the caller is using next or sampleInterlaced. |
+ // Only one can be used per sampler. |
+ enum SampleMode { |
+ kUninitialized_SampleMode, |
+ kConsecutive_SampleMode, |
+ kInterlaced_SampleMode, |
+ }; |
+ |
+ SampleMode fSampleMode; |
+#endif |
+ |
// setup state |
char* fDstRow; // points into bitmap's pixels |
size_t fDstRowBytes; |