If drawing an image as tiled fails, fallback to other methods.
When rendering cross-context images, we can end up with a situation where the image thinks it should be tiled because it won't fit in the cache, but we can't tile it because getROPixels fails. In this case, the image should be backed by the client, so we should be able to render it through a TextureProducer. Bug: skia:9562 Change-Id: I172e1008ca423f46b0c7b445bdf3eb573215adfb Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251458 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
5f95519d54
commit
352f4f7800
@ -424,11 +424,10 @@ void SkGpuDevice::drawImageQuad(const SkImage* image, const SkRect* srcRect, con
|
||||
SkBitmap bm;
|
||||
if (this->shouldTileImage(image, &src, constraint, paint.getFilterQuality(), ctm, srcToDst)) {
|
||||
// only support tiling as bitmap at the moment, so force raster-version
|
||||
if (!as_IB(image)->getROPixels(&bm)) {
|
||||
if (as_IB(image)->getROPixels(&bm)) {
|
||||
this->drawBitmapRect(bm, &src, dst, paint, constraint);
|
||||
return;
|
||||
}
|
||||
this->drawBitmapRect(bm, &src, dst, paint, constraint);
|
||||
return;
|
||||
}
|
||||
|
||||
// This is the funnel for all non-tiled bitmap/image draw calls. Log a histogram entry.
|
||||
|
Loading…
Reference in New Issue
Block a user