[gtk] gl renderer: Set the render region as initial clip
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: Set the render region as initial clip
- Date: Sun, 2 Dec 2018 15:18:12 +0000 (UTC)
commit 3eb2cef4214afc93493cbb275467681ef622d5a3
Author: Timm Bäder <mail baedert org>
Date: Sun Dec 2 06:56:52 2018 +0100
gl renderer: Set the render region as initial clip
So we avoid creating render ops for things outside of it.
gsk/gl/gskglrenderer.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index c92b71b0f2..b7c7ebdc7d 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -2622,8 +2622,27 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
render_op_builder.current_viewport = *viewport;
render_op_builder.current_opacity = 1.0f;
render_op_builder.render_ops = self->render_ops;
- gsk_rounded_rect_init_from_rect (&render_op_builder.current_clip, viewport, 0.0f);
ops_push_modelview (&render_op_builder, &modelview);
+ /* Initial clip is self->render_region! */
+ if (self->render_region != NULL)
+ {
+ cairo_rectangle_int_t render_extents;
+
+ cairo_region_get_extents (self->render_region, &render_extents);
+ render_op_builder.current_clip = GSK_ROUNDED_RECT_INIT (render_extents.x,
+ render_extents.y,
+ render_extents.width,
+ render_extents.height);
+
+ ops_transform_bounds_modelview (&render_op_builder,
+ &render_op_builder.current_clip.bounds,
+ &render_op_builder.current_clip.bounds);
+ }
+ else
+ {
+ gsk_rounded_rect_init_from_rect (&render_op_builder.current_clip, viewport, 0.0f);
+ }
+
if (fbo_id != 0)
ops_set_render_target (&render_op_builder, fbo_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]