Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8cb5254 authored by Greg Daniel's avatar Greg Daniel
Browse files

Make sure we check for valid GrContext when pinning images.

Test: manual building and running.
Bug: 187540936
Change-Id: Ie900d80128646c8ca2d4fce41d436019e3cf9c71
parent 69a09397
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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));