[gtk/wip/chergert/macos-iosurface: 39/39] macos: only invalidate tiles when size changes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-iosurface: 39/39] macos: only invalidate tiles when size changes
- Date: Tue, 22 Feb 2022 19:54:35 +0000 (UTC)
commit 4e041be5b6c84a42e48f932a532fd26687a9f32f
Author: Christian Hergert <christian hergert me>
Date: Tue Feb 22 00:51:53 2022 -0800
macos: only invalidate tiles when size changes
If the size changes, we need to relayout the tiles. Otherwise we can keep
using what we had before. Generally, that shouldn't happen, but the
previous check was failing in a number of ways.
gdk/macos/GdkMacosLayer.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gdk/macos/GdkMacosLayer.c b/gdk/macos/GdkMacosLayer.c
index 4b723566d0..4de47a5658 100644
--- a/gdk/macos/GdkMacosLayer.c
+++ b/gdk/macos/GdkMacosLayer.c
@@ -317,13 +317,14 @@ fromCGRect (const CGRect rect)
-(void)setFrame:(NSRect)frame
{
- if (CGRectEqualToRect (frame, self.frame))
- return;
-
- self->_layoutInvalid = TRUE;
+ if (frame.size.width != self.bounds.size.width ||
+ frame.size.height != self.bounds.size.height)
+ {
+ self->_layoutInvalid = TRUE;
+ [self setNeedsLayout];
+ }
[super setFrame:frame];
- [self setNeedsLayout];
}
-(void)setOpaqueRegion:(const cairo_region_t *)opaqueRegion
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]