[mutter/wip/nielsdg/add-yuv-support: 58/59] WIP



commit 4262f7b68371ec2147b64b4e411d916fcd42456f
Author: Niels De Graef <Niels DeGraef barco com>
Date:   Thu Nov 29 17:13:07 2018 +0100

    WIP

 cogl/cogl/cogl-multi-plane-texture.c | 12 ++++++++++--
 src/wayland/meta-wayland-buffer.c    |  4 +---
 2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/cogl/cogl/cogl-multi-plane-texture.c b/cogl/cogl/cogl-multi-plane-texture.c
index abf3e492f..cf0d164e2 100644
--- a/cogl/cogl/cogl-multi-plane-texture.c
+++ b/cogl/cogl/cogl-multi-plane-texture.c
@@ -145,14 +145,22 @@ cogl_multi_plane_texture_new_from_bitmaps (CoglPixelFormat format,
     {
       CoglTexture *plane;
 
+      if (format == COGL_PIXEL_FORMAT_NV12)
+      {
+        if (i == 0)
+          _cogl_bitmap_set_format (bitmaps[i], COGL_PIXEL_FORMAT_A_8);
+        else
+          _cogl_bitmap_set_format (bitmaps[i], COGL_PIXEL_FORMAT_RG_88);
+      }
+
       plane = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmaps[i]));
 
       if (format == COGL_PIXEL_FORMAT_NV12)
       {
         if (i == 0)
         {
-          _cogl_texture_set_internal_format (plane, COGL_PIXEL_FORMAT_RG_88);
-          _cogl_bitmap_set_format (bitmaps[i], COGL_PIXEL_FORMAT_RG_88);
+          _cogl_texture_set_internal_format (plane, COGL_PIXEL_FORMAT_A_8);
+          _cogl_bitmap_set_format (bitmaps[i], COGL_PIXEL_FORMAT_A_8);
         }
         else
         {
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c
index 14fc5ab59..61a38eefb 100644
--- a/src/wayland/meta-wayland-buffer.c
+++ b/src/wayland/meta-wayland-buffer.c
@@ -542,6 +542,7 @@ process_shm_buffer_damage (MetaWaylandBuffer *buffer,
       for (j = 0; j < n_rectangles; j++)
         {
           cairo_rectangle_int_t rect;
+  gint height = wl_shm_buffer_get_height (shm_buffer);
 
           cairo_region_get_rectangle (region, i, &rect);
 
@@ -549,9 +550,6 @@ process_shm_buffer_damage (MetaWaylandBuffer *buffer,
           if (i > 0)
             offset += (stride / h_factors[i-1]) * (rect.height / v_factors[i-1]);
 
-          g_warning ("Creating plane %d/%d, h_factor = %d, v_factor = %d, offset = %d",
-                     i, n_planes, h_factors[i], v_factors[i], offset);
-
           if (!_cogl_texture_set_region (plane,
                                          rect.width / h_factors[i],
                                          rect.height / v_factors[i],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]