Index: src/codec/SkBmpRLECodec.cpp |
diff --git a/src/codec/SkBmpRLECodec.cpp b/src/codec/SkBmpRLECodec.cpp |
index b01012644bfded083a27c95deb41bff5be0f96be..b42d32a42e5d54ee77b2c5dfa674d992694852d7 100644 |
--- a/src/codec/SkBmpRLECodec.cpp |
+++ b/src/codec/SkBmpRLECodec.cpp |
@@ -503,8 +503,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)); |
} |