Make sure we check for valid GrContext when pinning images.

Test: manual building and running.
Bug: 187540936
Change-Id: Ie900d80128646c8ca2d4fce41d436019e3cf9c71
This commit is contained in:
Greg Daniel
2021-06-30 10:40:34 -04:00
parent 69a0939764
commit f8cb525497

View File

@@ -59,6 +59,10 @@ void SkiaPipeline::onDestroyHardwareResources() {
}
bool SkiaPipeline::pinImages(std::vector<SkImage*>& mutableImages) {
if (!mRenderThread.getGrContext()) {
ALOGD("Trying to pin an image with an invalid GrContext");
return false;
}
for (SkImage* image : mutableImages) {
if (SkImage_pinAsTexture(image, mRenderThread.getGrContext())) {
mPinnedImages.emplace_back(sk_ref_sp(image));