Skip to content
Snippets Groups Projects
Commit 088c3bea authored by Diego Wilson's avatar Diego Wilson Committed by Gerrit - the friendly Code Review server
Browse files

Remap RGBA and RGBX copybit formats

B2G treats RGBA gralloc buffers as BGRA and RGBX as XRGB

Change-Id: I7a9e145dc603b3e6aafcffe545626f27a00c3c9c
parent 6f734643
No related branches found
No related tags found
No related merge requests found
diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp
index 5407b6d..4563b47 100644
--- a/libcopybit/copybit.cpp
+++ b/libcopybit/copybit.cpp
@@ -444,6 +444,13 @@ static int stretch_copybit(
set_infos(ctx, req, flags);
set_image(&req->dst, dst);
set_image(&req->src, src);
+ if (req->src.format == MDP_RGBA_8888) {
+ req->src.format = MDP_BGRA_8888;
+ }
+ else if (req->src.format == MDP_RGBX_8888) {
+ req->src.format = MDP_XRGB_8888;
+ }
+
set_rects(ctx, req, dst_rect, src_rect, &clip, src->horiz_padding, src->vert_padding);
if (req->src_rect.w<=0 || req->src_rect.h<=0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment