[gtk/modern-testsuite: 1/6] ngl: Improve shortcuts for shadow nodes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/modern-testsuite: 1/6] ngl: Improve shortcuts for shadow nodes
- Date: Thu, 16 Sep 2021 18:42:10 +0000 (UTC)
commit c9efd62099e76f3a068e217e0880c9d46e9d87b4
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Sep 16 08:04:09 2021 -0400
ngl: Improve shortcuts for shadow nodes
For shadow nodes, we try pretty hard to avoid
rendering shadows, and and we have a shortcut
that just renders text offset, but we can try
harder to do nothing - if the text is offset
by zero, we don't need to draw it at all.
gsk/ngl/gsknglrenderjob.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 63da37b643..92d659f976 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -3055,21 +3055,24 @@ gsk_ngl_render_job_visit_shadow_node (GskNglRenderJob *job,
graphene_rect_t bounds;
guint16 color[4];
- if (shadow->radius == 0 &&
- gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE)
- {
- gsk_ngl_render_job_offset (job, dx, dy);
- gsk_ngl_render_job_visit_text_node (job, shadow_child, &shadow->color, TRUE);
- gsk_ngl_render_job_offset (job, -dx, -dy);
- continue;
- }
-
if (RGBA_IS_CLEAR (&shadow->color))
continue;
if (node_is_invisible (shadow_child))
continue;
+ if (shadow->radius == 0 &&
+ gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE)
+ {
+ if (dx != 0 || dy != 0)
+ {
+ gsk_ngl_render_job_offset (job, dx, dy);
+ gsk_ngl_render_job_visit_text_node (job, shadow_child, &shadow->color, TRUE);
+ gsk_ngl_render_job_offset (job, -dx, -dy);
+ }
+ continue;
+ }
+
if (shadow->radius > 0)
{
float min_x;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]