Avoid caching resources for volatile bitmap shaders

SkBitmapProvider::isVolatile() treats all SkImages as non-volatile,
which is not what we want for temp SkImage wrappers of volatile bitmaps.

R=reed@google.com
BUG=chromium:633941
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222783002

Review-Url: https://codereview.chromium.org/2222783002
This commit is contained in:
fmalita 2016-08-08 07:08:37 -07:00 committed by Commit bot
parent f21cd16228
commit 5d2befe006

View File

@ -49,7 +49,9 @@ SkImageInfo SkBitmapProvider::info() const {
bool SkBitmapProvider::isVolatile() const {
if (fImage) {
return false; // add flag to images?
// add flag to images?
const SkBitmap* bm = as_IB(fImage)->onPeekBitmap();
return bm ? bm->isVolatile() : false;
} else {
return fBitmap.isVolatile();
}