[gtk/wip/chergert/glproto: 615/920] handle clip more gracefully
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 615/920] handle clip more gracefully
- Date: Mon, 8 Feb 2021 19:15:32 +0000 (UTC)
commit db9ce4ece24cf67b22cba48a347d068a7f5f8f6b
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 1 18:38:50 2021 -0800
handle clip more gracefully
gsk/next/gskglprogram.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/gsk/next/gskglprogram.c b/gsk/next/gskglprogram.c
index 40a9fdf39b..4585e8548f 100644
--- a/gsk/next/gskglprogram.c
+++ b/gsk/next/gskglprogram.c
@@ -166,6 +166,9 @@ gsk_gl_program_begin_draw (GskGLProgram *self,
{
g_assert (GSK_IS_GL_PROGRAM (self));
g_assert (viewport != NULL);
+ g_assert (projection != NULL);
+ g_assert (modelview != NULL);
+ g_assert (clip != NULL);
if (self->viewport_location > -1)
gsk_gl_command_queue_set_uniform4f (self->command_queue,
@@ -188,11 +191,22 @@ gsk_gl_program_begin_draw (GskGLProgram *self,
self->projection_location,
projection);
- if (clip != NULL && self->clip_rect_location > -1)
- gsk_gl_command_queue_set_uniform_rounded_rect (self->command_queue,
- self->id,
- self->clip_rect_location,
- clip);
+ if (self->clip_rect_location > -1)
+ {
+ if (clip != NULL)
+ gsk_gl_command_queue_set_uniform_rounded_rect (self->command_queue,
+ self->id,
+ self->clip_rect_location,
+ clip);
+ else
+ gsk_gl_command_queue_set_uniform_rounded_rect (self->command_queue,
+ self->id,
+ self->clip_rect_location,
+ &GSK_ROUNDED_RECT_INIT (0,
+ 0,
+ viewport->size.width,
+ viewport->size.height));
+ }
gsk_gl_command_queue_begin_draw (self->command_queue, self->id, viewport);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]