[mutter/wip/nielsdg/add-yuv-support: 1/2] WIP: Add a COGL_TEXTURE_COMPONENTS_R



commit 12b0ed0ac2a815f2579f403d85ca7cb2acb54358
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 a07baf259..3bedb5ac0 100644
--- a/cogl/cogl/cogl-texture.c
+++ b/cogl/cogl/cogl-texture.c
@@ -1109,6 +1109,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;
@@ -1155,6 +1160,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 87612b810..6785a493f 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 c033395fe..f43bb9afa 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]