Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: src/codec/SkMaskSwizzler.h

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Fix ico, sampling Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/codec/SkMaskSwizzler.h
diff --git a/src/codec/SkMaskSwizzler.h b/src/codec/SkMaskSwizzler.h
index 794dcd16e498e8948a1065ba6e29bb31bdc8361a..fe729ab269634c0e0333a0331172fb38108e5704 100644
--- a/src/codec/SkMaskSwizzler.h
+++ b/src/codec/SkMaskSwizzler.h
@@ -8,6 +8,7 @@
#define SkMaskSwizzler_DEFINED
#include "SkMasks.h"
+#include "SkSampler.h"
#include "SkSwizzler.h"
#include "SkTypes.h"
@@ -17,7 +18,7 @@
* Currently only used by bmp
*
*/
-class SkMaskSwizzler {
+class SkMaskSwizzler : public SkSampler {
public:
/*
@@ -46,15 +47,18 @@ private:
/*
* Constructor for mask swizzler
*/
- SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc,
- uint32_t sampleX);
-
- // Fields
- const SkImageInfo& fDstInfo;
- SkMasks* fMasks; // unowned
- const RowProc fRowProc;
- const uint32_t fSampleX;
- const uint32_t fStartX;
+ SkMaskSwizzler(int width, SkMasks* masks, RowProc proc);
+
+ int onSetSampleX(int) override;
+
+ SkMasks* fMasks; // unowned
+ const RowProc fRowProc;
+
+ // FIXME: Can this class share more with SkSwizzler? These variables are all the same.
+ const int fSrcWidth; // Width of the source - i.e. before any sampling.
+ int fDstWidth; // Width of dst, which may differ with sampling.
+ uint32_t fSampleX;
+ uint32_t fX0;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698