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

Commit 30c7800f authored by Nicolette Prevost's avatar Nicolette Prevost
Browse files

Update HWUI to use AHardwareBufferUtils rather than GrAHardwareBufferUtils

The `GetSkColorTypeFromBufferFormat` utility in `GrAHardwareBufferUtils` was centralized to be shared between graphite and ganesh in `AHardwareBufferUtils` as of https://skia-review.googlesource.com/c/skia/+/788978. Update HWUI accordingly.
(cherry picked from https://android-review.googlesource.com/q/commit:6a1a74d8aa6dddc22702660f47450a7779ebc9df)

Flag: EXEMPT refactor

Merged-In: I564b07b5c518989a3a2ab2cb40a9a15dcb608ae5
Change-Id: I564b07b5c518989a3a2ab2cb40a9a15dcb608ae5
parent c488e438
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "AutoBackendTextureRelease.h"

#include <SkImage.h>
#include <include/android/AHardwareBufferUtils.h>
#include <include/gpu/MutableTextureState.h>
#include <include/gpu/ganesh/GrBackendSurface.h>
#include <include/gpu/ganesh/GrDirectContext.h>
@@ -120,7 +121,7 @@ void AutoBackendTextureRelease::makeImage(AHardwareBuffer* buffer,
                                          GrDirectContext* context) {
    AHardwareBuffer_Desc desc;
    AHardwareBuffer_describe(buffer, &desc);
    SkColorType colorType = GrAHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format);
    SkColorType colorType = AHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format);
    // The following ref will be counteracted by Skia calling releaseProc, either during
    // BorrowTextureFrom if there is a failure, or later when SkImage is discarded. It must
    // be called before BorrowTextureFrom, otherwise Skia may remove HWUI's ref on failure.