Skip to content

Commit

Permalink
Fix shm import color mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
queezle42 committed Jul 27, 2024
1 parent 55ff53f commit 64d3832
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions quasar-wayland-skia/src/Quasar/Wayland/Skia.hs
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ copyShmBuffer skia (Owned bufferDisposer shmBuffer) = do
liftIO [CPPU.throwBlock|void {
GrDirectContext* grDirectContext = $(GrDirectContext* grDirectContext);

auto colorType = $(uint32_t format) == 0 ? kRGBA_8888_SkColorType : kRGB_888x_SkColorType;
SkImageInfo info = SkImageInfo::Make($(int width), $(int height), colorType, kPremul_SkAlphaType);
// kBGRA_8888_SkColorType maps to wl_shm argb8888
auto colorType = kBGRA_8888_SkColorType;
SkImageInfo info = SkImageInfo::Make($(int width), $(int height), colorType, $(uint32_t format) == 0 ? kPremul_SkAlphaType : kOpaque_SkAlphaType);

SkPixmap pixmap(info, (void*)($(uint8_t* ptr) + $(size_t offset)), $(size_t rowBytes));

Expand Down

0 comments on commit 64d3832

Please sign in to comment.