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

Commit e7fb46f5 authored by Kevin Lubick's avatar Kevin Lubick
Browse files

Use SkImages::BorrowTextureFrom

Follow-up to https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/22135940

Change-Id: Ibc95582a0de139d5d17b225aeadb8bbe6c1f5b9e
Bug: skbug.com/13983
parent 167d246a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@
#define LOG_TAG "RenderEngine"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS

#include <SkImage.h>
#include <include/gpu/ganesh/SkImageGanesh.h>

#include "ColorSpaces.h"
#include "log/log_main.h"
#include "utils/Trace.h"
@@ -98,8 +101,9 @@ sk_sp<SkImage> AutoBackendTexture::makeImage(ui::Dataspace dataspace, SkAlphaTyp
    }

    sk_sp<SkImage> image =
            SkImage::MakeFromTexture(context, mBackendTexture, kTopLeft_GrSurfaceOrigin, colorType,
                                     alphaType, toSkColorSpace(dataspace), releaseImageProc, this);
            SkImages::BorrowTextureFrom(context, mBackendTexture, kTopLeft_GrSurfaceOrigin,
                                        colorType, alphaType, toSkColorSpace(dataspace),
                                        releaseImageProc, this);
    if (image.get()) {
        // The following ref will be counteracted by releaseProc, when SkImage is discarded.
        ref();