[gtk/wip/chergert/glproto: 74/82] add execute func
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 74/82] add execute func
- Date: Thu, 24 Dec 2020 00:35:07 +0000 (UTC)
commit 974cdb3c559606b08f9d8f8320b3608a2b753e97
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 20 11:18:41 2020 -0800
add execute func
gsk/next/gskglcommandqueue.c | 12 +++++++++---
gsk/next/gskglcommandqueueprivate.h | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 4d82f8fccf..53751e0424 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -979,7 +979,7 @@ gsk_gl_command_queue_set_uniform_rounded_rect (GskGLCommandQueue *self,
*
* Executes all of the batches in the command queue.
*/
-static void
+void
gsk_gl_command_queue_execute (GskGLCommandQueue *self)
{
GskGLCommandBatch *last_batch;
@@ -999,6 +999,14 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self)
gsk_gl_command_queue_make_current (self);
+ glEnable (GL_DEPTH_TEST);
+ glDepthFunc (GL_LEQUAL);
+
+ /* Pre-multiplied alpha */
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glBlendEquation (GL_FUNC_ADD);
+
glGenVertexArrays (1, &vao_id);
glBindVertexArray (vao_id);
@@ -1061,8 +1069,6 @@ gsk_gl_command_queue_end_frame (GskGLCommandQueue *self)
{
g_return_if_fail (GSK_IS_GL_COMMAND_QUEUE (self));
- gsk_gl_command_queue_execute (self);
-
while (self->all_batches.length > 0)
{
GskGLCommandBatch *batch = self->all_batches.head->data;
diff --git a/gsk/next/gskglcommandqueueprivate.h b/gsk/next/gskglcommandqueueprivate.h
index 38b948f1b9..f4eaf109d4 100644
--- a/gsk/next/gskglcommandqueueprivate.h
+++ b/gsk/next/gskglcommandqueueprivate.h
@@ -34,6 +34,7 @@ GdkGLContext *gsk_gl_command_queue_get_context (GskGLCommandQu
void gsk_gl_command_queue_make_current (GskGLCommandQueue *self);
void gsk_gl_command_queue_begin_frame (GskGLCommandQueue *self);
void gsk_gl_command_queue_end_frame (GskGLCommandQueue *self);
+void gsk_gl_command_queue_execute (GskGLCommandQueue *self);
GdkTexture *gsk_gl_command_queue_download (GskGLCommandQueue *self,
GError **error);
GdkMemoryTexture *gsk_gl_command_queue_download_texture (GskGLCommandQueue *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]