aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codec/SkBmpRLECodec.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/codec/SkBmpRLECodec.cpp b/src/codec/SkBmpRLECodec.cpp
index 57707d60c9..05691cc079 100644
--- a/src/codec/SkBmpRLECodec.cpp
+++ b/src/codec/SkBmpRLECodec.cpp
@@ -520,8 +520,13 @@ private:
SkBmpRLECodec* fCodec;
};
-SkSampler* SkBmpRLECodec::getSampler(bool createIfNecessary) {
- if (!fSampler && createIfNecessary) {
+SkSampler* SkBmpRLECodec::getSampler(bool /*createIfNecessary*/) {
+ // We will always create an SkBmpRLESampler if one is requested.
+ // This allows clients to always use the SkBmpRLESampler's
+ // version of fill(), which does nothing since RLE decodes have
+ // already filled pixel memory. This seems fine, since creating
+ // an SkBmpRLESampler is pretty inexpensive.
+ if (!fSampler) {
fSampler.reset(new SkBmpRLESampler(this));
}