From abc80542369a6297534cec5a439b1381720b8296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=91=E5=B1=91=E5=B1=91?= Date: Thu, 7 Aug 2025 19:10:12 +0800 Subject: [PATCH] fix skia update error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 屑屑屑 --- .../egl_image/src/pixel_map_from_surface.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frameworks/innerkitsimpl/egl_image/src/pixel_map_from_surface.cpp b/frameworks/innerkitsimpl/egl_image/src/pixel_map_from_surface.cpp index 69ecc920a..c22221bac 100644 --- a/frameworks/innerkitsimpl/egl_image/src/pixel_map_from_surface.cpp +++ b/frameworks/innerkitsimpl/egl_image/src/pixel_map_from_surface.cpp @@ -17,6 +17,16 @@ #include "image_log.h" #include "sync_fence.h" +#ifdef USE_M133_SKIA +#include "include/gpu/ganesh/gl/GrGLBackendSurface.h" +#include "include/gpu/ganesh/gl/GrGLInterface.h" +#include "include/gpu/ganesh/GrBackendSurface.h" +#include "include/gpu/ganesh/GrDirectContext.h" +#include "include/gpu/ganesh/GrRecordingContext.h" +#include "include/gpu/ganesh/SkImageGanesh.h" +#include "include/gpu/ganesh/SkSurfaceGanesh.h" +#include "include/gpu/GpuTypes.h" +#endif #undef LOG_DOMAIN #define LOG_DOMAIN LOG_TAG_DOMAIN_ID_IMAGE @@ -146,9 +156,9 @@ bool PixelMapFromSurface::DrawImage(const Rect &srcRect) glType = GL_RGB10_A2; } #ifdef USE_M133_SKIA - GrMockTextureInfo grExternalTextureInfo; - auto backendTexturePtr = - std::make_shared(bufferWidth, bufferHeight, skgpu::Mipmapped::kNo, grExternalTextureInfo); + GrGLTextureInfo grExternalTextureInfo = { GL_TEXTURE_EXTERNAL_OES, texId_, static_cast(glType) }; + auto backendTexturePtr = std::make_shared( + GrBackendTextures::MakeGL(bufferWidth, bufferHeight, skgpu::Mipmapped::kNo, grExternalTextureInfo)); auto image = SkImages::BorrowTextureFrom(renderContext_->GetGrContext().get(), *backendTexturePtr, kTopLeft_GrSurfaceOrigin, colorType, kPremul_SkAlphaType, nullptr); #else -- Gitee