Use per-display debug flags for visual debugging
This commit is contained in:
parent
02742d5332
commit
1a5cb41bd9
@ -31,6 +31,7 @@
|
||||
#include "gtkrenderbackgroundprivate.h"
|
||||
#include "gtkrenderborderprivate.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
/*
|
||||
* Gadgets are 'next-generation widgets' - they combine a CSS node
|
||||
@ -887,7 +888,9 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
height - margin.top - margin.bottom);
|
||||
|
||||
#if G_ENABLE_DEBUG
|
||||
if (GTK_DEBUG_CHECK (LAYOUT))
|
||||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (gtk_css_gadget_get_owner (gadget));
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (display, LAYOUT))
|
||||
{
|
||||
cairo_save (cr);
|
||||
cairo_new_path (cr);
|
||||
@ -909,7 +912,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
cairo_stroke (cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
if (GTK_DEBUG_CHECK (BASELINES))
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
|
||||
{
|
||||
int baseline = priv->allocated_baseline;
|
||||
|
||||
@ -931,6 +934,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
cairo_restore (cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkpixelcacheprivate.h"
|
||||
#include "gtkrenderbackgroundprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
@ -186,7 +187,7 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache *cache,
|
||||
cairo_content_t content;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GTK_DEBUG_CHECK (NO_PIXEL_CACHE))
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (gdk_window_get_display (window), NO_PIXEL_CACHE))
|
||||
return;
|
||||
#endif
|
||||
|
||||
@ -329,6 +330,7 @@ _gtk_pixel_cache_set_position (GtkPixelCache *cache,
|
||||
|
||||
static void
|
||||
_gtk_pixel_cache_repaint (GtkPixelCache *cache,
|
||||
GdkWindow *window,
|
||||
GtkPixelCacheDrawFunc draw,
|
||||
cairo_rectangle_int_t *view_rect,
|
||||
cairo_rectangle_int_t *canvas_rect,
|
||||
@ -361,7 +363,7 @@ _gtk_pixel_cache_repaint (GtkPixelCache *cache,
|
||||
cairo_restore (backing_cr);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GTK_DEBUG_CHECK (PIXEL_CACHE))
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (gdk_window_get_display (window), PIXEL_CACHE))
|
||||
{
|
||||
GdkRGBA colors[] = {
|
||||
{ 1, 0, 0, 0.08},
|
||||
@ -449,7 +451,7 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache,
|
||||
_gtk_pixel_cache_create_surface_if_needed (cache, window,
|
||||
view_rect, canvas_rect);
|
||||
_gtk_pixel_cache_set_position (cache, view_rect, canvas_rect);
|
||||
_gtk_pixel_cache_repaint (cache, draw, view_rect, canvas_rect, user_data);
|
||||
_gtk_pixel_cache_repaint (cache, window, draw, view_rect, canvas_rect, user_data);
|
||||
|
||||
if (cache->surface && context_is_unscaled (cr) &&
|
||||
/* Don't use backing surface if rendering elsewhere */
|
||||
|
@ -6988,7 +6988,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GTK_DEBUG_CHECK (BASELINES))
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (gtk_widget_get_display (widget), BASELINES))
|
||||
{
|
||||
gint baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
gint width = gtk_widget_get_allocated_width (widget);
|
||||
@ -7005,8 +7005,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
|
||||
cairo_restore (cr);
|
||||
}
|
||||
}
|
||||
|
||||
if (GTK_DEBUG_CHECK (RESIZE) &&
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (gtk_widget_get_display (widget), RESIZE) &&
|
||||
widget->priv->highlight_resize)
|
||||
{
|
||||
GtkAllocation alloc;
|
||||
|
Loading…
Reference in New Issue
Block a user