Guarded version of change to lazy image readPixels
Just the behavior-affecting portion of https://skia-review.googlesource.com/c/skia/+/164040, so I can rebaseline Chrome. Bug: skia: Change-Id: Iddc5d8918050a023d5d1d09bf4828e59494daa6f Reviewed-on: https://skia-review.googlesource.com/c/164043 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
294861ff95
commit
dae3585451
@ -248,6 +248,7 @@ bool SkImage_Lazy::lockAsBitmap(SkBitmap* bitmap, SkImage::CachingHint chint,
|
||||
bool SkImage_Lazy::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
|
||||
int srcX, int srcY, CachingHint chint) const {
|
||||
SkBitmap bm;
|
||||
#ifdef SK_USE_LEGACY_LAZY_IMAGE_DECODE
|
||||
if (kDisallow_CachingHint == chint) {
|
||||
if (this->lockAsBitmapOnlyIfAlreadyCached(&bm, dstInfo)) {
|
||||
return bm.readPixels(dstInfo, dstPixels, dstRB, srcX, srcY);
|
||||
@ -261,6 +262,7 @@ bool SkImage_Lazy::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, siz
|
||||
// else fall through
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (this->getROPixels(&bm, chint)) {
|
||||
return bm.readPixels(dstInfo, dstPixels, dstRB, srcX, srcY);
|
||||
|
Loading…
Reference in New Issue
Block a user