[mutter/wip/nielsdg/add-yuv-support: 53/56] WIP: Add a COGL_TEXTURE_COMPONENTS_R



commit 6c97f7aff84bc4162db15e39a80b7e4a24073ec4
Author: Niels De Graef <niels degraef barco com>
Date:   Thu Jun 13 14:41:07 2019 +0200

    WIP: Add a COGL_TEXTURE_COMPONENTS_R

 cogl/cogl/cogl-texture.c            | 7 +++++++
 cogl/cogl/cogl-texture.h            | 1 +
 src/compositor/meta-background.c    | 1 +
 src/compositor/meta-surface-actor.c | 1 +
 4 files changed, 10 insertions(+)
---
diff --git a/cogl/cogl/cogl-texture.c b/cogl/cogl/cogl-texture.c
index 96bada164..f57d4a770 100644
--- a/cogl/cogl/cogl-texture.c
+++ b/cogl/cogl/cogl-texture.c
@@ -1103,6 +1103,11 @@ _cogl_texture_set_internal_format (CoglTexture *texture,
       texture->components = COGL_TEXTURE_COMPONENTS_A;
       return;
     }
+  else if (internal_format == COGL_PIXEL_FORMAT_R_8)
+    {
+      texture->components = COGL_TEXTURE_COMPONENTS_R;
+      return;
+    }
   else if (internal_format == COGL_PIXEL_FORMAT_RG_88)
     {
       texture->components = COGL_TEXTURE_COMPONENTS_RG;
@@ -1149,6 +1154,8 @@ _cogl_texture_determine_internal_format (CoglTexture *texture,
         }
     case COGL_TEXTURE_COMPONENTS_A:
       return COGL_PIXEL_FORMAT_A_8;
+    case COGL_TEXTURE_COMPONENTS_R:
+      return COGL_PIXEL_FORMAT_R_8;
     case COGL_TEXTURE_COMPONENTS_RG:
       return COGL_PIXEL_FORMAT_RG_88;
     case COGL_TEXTURE_COMPONENTS_RGB:
diff --git a/cogl/cogl/cogl-texture.h b/cogl/cogl/cogl-texture.h
index 924912d02..06fa6d892 100644
--- a/cogl/cogl/cogl-texture.h
+++ b/cogl/cogl/cogl-texture.h
@@ -139,6 +139,7 @@ cogl_is_texture (void *object);
 typedef enum _CoglTextureComponents
 {
   COGL_TEXTURE_COMPONENTS_A = 1,
+  COGL_TEXTURE_COMPONENTS_R,
   COGL_TEXTURE_COMPONENTS_RG,
   COGL_TEXTURE_COMPONENTS_RGB,
   COGL_TEXTURE_COMPONENTS_RGBA,
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 4efc1ed54..5e99aaf72 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -632,6 +632,7 @@ texture_has_alpha (CoglTexture *texture)
     case COGL_TEXTURE_COMPONENTS_A:
     case COGL_TEXTURE_COMPONENTS_RGBA:
       return TRUE;
+    case COGL_TEXTURE_COMPONENTS_R:
     case COGL_TEXTURE_COMPONENTS_RG:
     case COGL_TEXTURE_COMPONENTS_RGB:
     case COGL_TEXTURE_COMPONENTS_DEPTH:
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index ca4ca19a9..bcb6ce73a 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -343,6 +343,7 @@ meta_surface_actor_is_argb32 (MetaSurfaceActor *self)
     case COGL_TEXTURE_COMPONENTS_A:
     case COGL_TEXTURE_COMPONENTS_RGBA:
       return TRUE;
+    case COGL_TEXTURE_COMPONENTS_R:
     case COGL_TEXTURE_COMPONENTS_RG:
     case COGL_TEXTURE_COMPONENTS_RGB:
     case COGL_TEXTURE_COMPONENTS_DEPTH:


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