Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Determine Skia color type from EGL surface format
  • Loading branch information
vially committed Sep 25, 2024
commit 7cb335d91a6c331a225cc1c28cc8c8ec6277b42f
8 changes: 7 additions & 1 deletion shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,17 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(

SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

std::optional<SkColorType> color_type =
FlutterFormatToSkColorType(surface->format);
if (!color_type) {
return nullptr;
}

auto sk_surface = SkSurfaces::WrapBackendRenderTarget(
context, // context
backend_render_target, // backend render target
kBottomLeft_GrSurfaceOrigin, // surface origin
kN32_SkColorType, // color type
color_type.value(), // color type
SkColorSpace::MakeSRGB(), // color space
&surface_properties, // surface properties
static_cast<SkSurfaces::RenderTargetReleaseProc>(
Expand Down