[gtk/wip/chergert/macos-iosurface] use backgroundColor to make tiles opaque to compositor
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-iosurface] use backgroundColor to make tiles opaque to compositor
- Date: Wed, 9 Feb 2022 22:20:47 +0000 (UTC)
commit 9ce369ac500465e34a5a66b7ad1ee49c3892ac29
Author: Christian Hergert <christian hergert me>
Date: Wed Feb 9 14:19:47 2022 -0800
use backgroundColor to make tiles opaque to compositor
gdk/macos/GdkMacosTile.c | 12 ++++++------
gdk/macos/GdkMacosTile.h | 2 --
2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gdk/macos/GdkMacosTile.c b/gdk/macos/GdkMacosTile.c
index 09e82542c2..dd7c84b95d 100644
--- a/gdk/macos/GdkMacosTile.c
+++ b/gdk/macos/GdkMacosTile.c
@@ -29,14 +29,14 @@
return YES;
}
--(BOOL)isOpaque
-{
- return self->_opaque;
-}
-
-(void)setOpaque:(BOOL)opaque
{
- self->_opaque = opaque;
+ [super setOpaque:opaque];
+
+ if (opaque)
+ self.backgroundColor = NSColor.blackColor.CGColor;
+ else
+ self.backgroundColor = NSColor.clearColor.CGColor;
}
-(void)swapBuffer:(IOSurfaceRef)buffer withRect:(CGRect)rect
diff --git a/gdk/macos/GdkMacosTile.h b/gdk/macos/GdkMacosTile.h
index 09295800fb..296a8d7c70 100644
--- a/gdk/macos/GdkMacosTile.h
+++ b/gdk/macos/GdkMacosTile.h
@@ -26,10 +26,8 @@
@interface GdkMacosTile : CALayer
{
- guint _opaque : 1;
};
--(void)setOpaque:(BOOL)opaque;
-(void)swapBuffer:(IOSurfaceRef)buffer withRect:(CGRect)rect;
@end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]