mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-20 14:00:10 +00:00
gdk: Remove GDK_DEBUG=cairo-image
This is the default now - at least until cairo rendering gets split into backends.
This commit is contained in:
parent
54a83d0288
commit
899674d445
@ -150,8 +150,7 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{ "gl-legacy", GDK_DEBUG_GL_LEGACY },
|
||||
{ "gl-gles", GDK_DEBUG_GL_GLES },
|
||||
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE },
|
||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE },
|
||||
{ "cairo-image", GDK_DEBUG_CAIRO_IMAGE }
|
||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -64,8 +64,7 @@ typedef enum {
|
||||
GDK_DEBUG_GL_LEGACY = 1 << 15,
|
||||
GDK_DEBUG_GL_GLES = 1 << 16,
|
||||
GDK_DEBUG_VULKAN_DISABLE = 1 << 17,
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 18,
|
||||
GDK_DEBUG_CAIRO_IMAGE = 1 << 19
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 18
|
||||
} GdkDebugFlags;
|
||||
|
||||
extern guint _gdk_debug_flags;
|
||||
|
@ -4610,30 +4610,17 @@ gdk_surface_create_similar_surface (GdkSurface * surface,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
cairo_surface_t *surface_surface, *similar_surface;
|
||||
double sx, sy;
|
||||
cairo_surface_t *similar_surface;
|
||||
int scale;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
|
||||
|
||||
surface_surface = gdk_surface_ref_impl_surface (surface);
|
||||
sx = sy = 1;
|
||||
cairo_surface_get_device_scale (surface_surface, &sx, &sy);
|
||||
scale = gdk_surface_get_scale_factor (surface);
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (surface->display, CAIRO_IMAGE))
|
||||
{
|
||||
similar_surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
|
||||
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
|
||||
width * sx, height * sy);
|
||||
cairo_surface_set_device_scale (similar_surface, sx, sy);
|
||||
}
|
||||
else
|
||||
{
|
||||
similar_surface = cairo_surface_create_similar (surface_surface,
|
||||
content,
|
||||
width, height);
|
||||
}
|
||||
|
||||
cairo_surface_destroy (surface_surface);
|
||||
similar_surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
|
||||
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
|
||||
width * scale, height * scale);
|
||||
cairo_surface_set_device_scale (similar_surface, scale, scale);
|
||||
|
||||
return similar_surface;
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ struct _GtkInspectorVisualPrivate
|
||||
GtkAdjustment *cursor_size_adjustment;
|
||||
|
||||
GtkWidget *debug_box;
|
||||
GtkWidget *rendering_mode_combo;
|
||||
GtkWidget *baselines_switch;
|
||||
GtkWidget *layout_switch;
|
||||
GtkWidget *touchscreen_switch;
|
||||
@ -836,34 +835,6 @@ init_gl (GtkInspectorVisual *vis)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
init_rendering_mode (GtkInspectorVisual *vis)
|
||||
{
|
||||
GdkDebugFlags flags = gdk_display_get_debug_flags (gdk_display_get_default ());
|
||||
int mode = 0;
|
||||
|
||||
if (flags & GDK_DEBUG_CAIRO_IMAGE)
|
||||
mode = 1;
|
||||
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (vis->priv->rendering_mode_combo), mode);
|
||||
}
|
||||
|
||||
static void
|
||||
rendering_mode_changed (GtkComboBox *c,
|
||||
GtkInspectorVisual *vis)
|
||||
{
|
||||
GdkDebugFlags flags = gdk_display_get_debug_flags (gdk_display_get_default ());
|
||||
int mode;
|
||||
|
||||
mode = gtk_combo_box_get_active (c);
|
||||
|
||||
flags = flags & ~GDK_DEBUG_CAIRO_IMAGE;
|
||||
if (mode == 1)
|
||||
flags = flags | GDK_DEBUG_CAIRO_IMAGE;
|
||||
|
||||
gdk_display_set_debug_flags (gdk_display_get_default (), flags);
|
||||
}
|
||||
|
||||
static void
|
||||
update_gl_flag (GtkSwitch *sw,
|
||||
GdkDebugFlags flag)
|
||||
@ -904,7 +875,6 @@ gtk_inspector_visual_init (GtkInspectorVisual *vis)
|
||||
init_font (vis);
|
||||
init_font_scale (vis);
|
||||
init_scale (vis);
|
||||
init_rendering_mode (vis);
|
||||
init_animation (vis);
|
||||
init_slowdown (vis);
|
||||
init_touchscreen (vis);
|
||||
@ -936,7 +906,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
|
||||
object_class->constructed = gtk_inspector_visual_constructed;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/visual.ui");
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, rendering_mode_combo);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, direction_combo);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, baselines_switch);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, layout_switch);
|
||||
@ -965,7 +934,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
|
||||
gtk_widget_class_bind_template_callback (widget_class, fps_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, updates_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, direction_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, rendering_mode_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, baselines_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, layout_activate);
|
||||
gtk_widget_class_bind_template_callback (widget_class, widget_resize_activate);
|
||||
|
@ -374,37 +374,6 @@
|
||||
<child>
|
||||
<object class="GtkListBox" id="debug_box">
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="spacing">40</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rendering_mode_label">
|
||||
<property name="label" translatable="yes">Rendering Mode</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="rendering_mode_combo">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="hexpand">1</property>
|
||||
<signal name="changed" handler="rendering_mode_changed"/>
|
||||
<items>
|
||||
<item translatable="yes" id="similar">Similar</item>
|
||||
<item translatable="yes" id="image">Image</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
@ -678,7 +647,6 @@
|
||||
<widget name="direction_label"/>
|
||||
<widget name="hidpi_label"/>
|
||||
<widget name="animation_label"/>
|
||||
<widget name="rendering_mode_label"/>
|
||||
<widget name="updates_label"/>
|
||||
<widget name="baselines_label"/>
|
||||
<widget name="layout_label"/>
|
||||
@ -695,7 +663,6 @@
|
||||
<widget name="cursor_combo"/>
|
||||
<widget name="font_button"/>
|
||||
<widget name="direction_combo"/>
|
||||
<widget name="rendering_mode_combo"/>
|
||||
<widget name="gl_combo"/>
|
||||
</widgets>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user