diff options
Diffstat (limited to 'chromium/third_party/skia/src/images/SkScaledBitmapSampler.h')
-rw-r--r-- | chromium/third_party/skia/src/images/SkScaledBitmapSampler.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chromium/third_party/skia/src/images/SkScaledBitmapSampler.h b/chromium/third_party/skia/src/images/SkScaledBitmapSampler.h index e6c4577174c..90c4142bdfb 100644 --- a/chromium/third_party/skia/src/images/SkScaledBitmapSampler.h +++ b/chromium/third_party/skia/src/images/SkScaledBitmapSampler.h @@ -34,11 +34,24 @@ public: kRGB_565 // 2 bytes per pixel }; + struct Options { + bool fDither; + bool fPremultiplyAlpha; + bool fSkipZeros; + explicit Options(const SkImageDecoder &dec) + : fDither(dec.getDitherImage()) + , fPremultiplyAlpha(!dec.getRequireUnpremultipliedColors()) + , fSkipZeros(dec.getSkipWritingZeroes()) + { } + }; + // Given a dst bitmap (with pixels already allocated) and a src-config, // prepares iterator to process the src colors and write them into dst. // Returns false if the request cannot be fulfulled. bool begin(SkBitmap* dst, SrcConfig sc, const SkImageDecoder& decoder, const SkPMColor* = NULL); + bool begin(SkBitmap* dst, SrcConfig sc, const Options& opts, + const SkPMColor* = NULL); // call with row of src pixels, for y = 0...scaledHeight-1. // returns true if the row had non-opaque alpha in it bool next(const uint8_t* SK_RESTRICT src); |