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

Unified Diff: src/images/SkScaledBitmapSampler.h

Issue 321873003: Add sampler options to SkScaledBitmapSampler (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | src/images/SkScaledBitmapSampler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkScaledBitmapSampler.h
diff --git a/src/images/SkScaledBitmapSampler.h b/src/images/SkScaledBitmapSampler.h
index e6c4577174c3551afbdf1b228b658d1b668113fe..e47d179a9092ccf3ac25ad82647709d3a766079c 100644
--- a/src/images/SkScaledBitmapSampler.h
+++ b/src/images/SkScaledBitmapSampler.h
@@ -34,11 +34,24 @@ public:
kRGB_565 // 2 bytes per pixel
};
+ struct SamplerOptions {
hal.canary 2014/06/09 20:22:49 Since it's already namespaced, SkScaledBitmapSampl
krajcevski 2014/06/09 20:45:38 Done.
+ bool fDither;
+ bool fPremultiplyAlpha;
+ bool fSkipZeros;
+ explicit SamplerOptions(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 SamplerOptions& 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);
« no previous file with comments | « no previous file | src/images/SkScaledBitmapSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698