[gtk+/wip/ebassi/gsk-renderer: 28/58] gsk: Add getter for program id in ShaderBuilder



commit 5097f5db2cd99a80c86c05c8e8609cb60ba54e37
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Jul 3 22:53:16 2016 +0100

    gsk: Add getter for program id in ShaderBuilder
    
    Since we store it into the ShaderBuilder instance we should also allow
    getting the program id.

 gsk/gskshaderbuilder.c        |    8 ++++++++
 gsk/gskshaderbuilderprivate.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskshaderbuilder.c b/gsk/gskshaderbuilder.c
index 5142e43..b17c41a 100644
--- a/gsk/gskshaderbuilder.c
+++ b/gsk/gskshaderbuilder.c
@@ -395,3 +395,11 @@ gsk_shader_builder_get_attribute_location (GskShaderBuilder *builder,
 
   return -1;
 }
+
+int
+gsk_shader_builder_get_program (GskShaderBuilder *builder)
+{
+  g_return_val_if_fail (GSK_IS_SHADER_BUILDER (builder), -1);
+
+  return builder->program_id;
+}
diff --git a/gsk/gskshaderbuilderprivate.h b/gsk/gskshaderbuilderprivate.h
index f5f7ff8..ce069ed 100644
--- a/gsk/gskshaderbuilderprivate.h
+++ b/gsk/gskshaderbuilderprivate.h
@@ -35,6 +35,7 @@ int                     gsk_shader_builder_create_program               (GskShad
                                                                          int               fragment_id,
                                                                          GError          **error);
 
+int                     gsk_shader_builder_get_program                  (GskShaderBuilder *builder);
 int                     gsk_shader_builder_get_uniform_location         (GskShaderBuilder *builder,
                                                                          GQuark            uniform_quark);
 int                     gsk_shader_builder_get_attribute_location       (GskShaderBuilder *builder,


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