mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
GskRenderer: Remove viewport property
This commit is contained in:
parent
19871cfd68
commit
b488329104
@ -99,7 +99,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
|
||||
GskRenderNode *root)
|
||||
{
|
||||
GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer);
|
||||
graphene_rect_t viewport;
|
||||
GdkWindow *window = gsk_renderer_get_window (renderer);
|
||||
|
||||
cairo_t *cr;
|
||||
|
||||
@ -107,17 +107,13 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
|
||||
|
||||
g_return_if_fail (cr != NULL);
|
||||
|
||||
gsk_renderer_get_viewport (renderer, &viewport);
|
||||
|
||||
if (GSK_RENDER_MODE_CHECK (GEOMETRY))
|
||||
{
|
||||
cairo_save (cr);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_rectangle (cr,
|
||||
viewport.origin.x,
|
||||
viewport.origin.y,
|
||||
viewport.size.width,
|
||||
viewport.size.height);
|
||||
0, 0,
|
||||
gdk_window_get_width (window), gdk_window_get_height (window));
|
||||
cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5);
|
||||
cairo_stroke (cr);
|
||||
cairo_restore (cr);
|
||||
|
@ -66,8 +66,6 @@ typedef struct
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
graphene_rect_t viewport;
|
||||
|
||||
GskScalingFilter min_filter;
|
||||
GskScalingFilter mag_filter;
|
||||
|
||||
@ -84,8 +82,7 @@ typedef struct
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
|
||||
|
||||
enum {
|
||||
PROP_VIEWPORT = 1,
|
||||
PROP_WINDOW,
|
||||
PROP_WINDOW = 1,
|
||||
PROP_DISPLAY,
|
||||
PROP_DRAWING_CONTEXT,
|
||||
|
||||
@ -194,10 +191,6 @@ gsk_renderer_set_property (GObject *gobject,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_VIEWPORT:
|
||||
gsk_renderer_set_viewport (self, g_value_get_boxed (value));
|
||||
break;
|
||||
|
||||
case PROP_DISPLAY:
|
||||
/* Construct-only */
|
||||
priv->display = g_value_dup_object (value);
|
||||
@ -220,10 +213,6 @@ gsk_renderer_get_property (GObject *gobject,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_VIEWPORT:
|
||||
g_value_set_boxed (value, &priv->viewport);
|
||||
break;
|
||||
|
||||
case PROP_WINDOW:
|
||||
g_value_set_object (value, priv->window);
|
||||
break;
|
||||
@ -277,22 +266,6 @@ gsk_renderer_class_init (GskRendererClass *klass)
|
||||
gobject_class->get_property = gsk_renderer_get_property;
|
||||
gobject_class->dispose = gsk_renderer_dispose;
|
||||
|
||||
/**
|
||||
* GskRenderer:viewport:
|
||||
*
|
||||
* The visible area used by the #GskRenderer to render its contents.
|
||||
*
|
||||
* Since: 3.90
|
||||
*/
|
||||
gsk_renderer_properties[PROP_VIEWPORT] =
|
||||
g_param_spec_boxed ("viewport",
|
||||
"Viewport",
|
||||
"The visible area used by the renderer",
|
||||
GRAPHENE_TYPE_RECT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GskRenderer:display:
|
||||
*
|
||||
@ -343,60 +316,6 @@ gsk_renderer_init (GskRenderer *self)
|
||||
priv->profiler = gsk_profiler_new ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_renderer_set_viewport:
|
||||
* @renderer: a #GskRenderer
|
||||
* @viewport: (nullable): the viewport rectangle used by the @renderer
|
||||
*
|
||||
* Sets the visible rectangle to be used as the viewport for
|
||||
* the rendering.
|
||||
*
|
||||
* Since: 3.90
|
||||
*/
|
||||
void
|
||||
gsk_renderer_set_viewport (GskRenderer *renderer,
|
||||
const graphene_rect_t *viewport)
|
||||
{
|
||||
GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
|
||||
|
||||
g_return_if_fail (GSK_IS_RENDERER (renderer));
|
||||
|
||||
if (viewport == NULL)
|
||||
{
|
||||
graphene_rect_init (&priv->viewport, 0.f, 0.f, 0.f, 0.f);
|
||||
g_object_notify_by_pspec (G_OBJECT (renderer), gsk_renderer_properties[PROP_VIEWPORT]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (graphene_rect_equal (viewport, &priv->viewport))
|
||||
return;
|
||||
|
||||
graphene_rect_init_from_rect (&priv->viewport, viewport);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (renderer), gsk_renderer_properties[PROP_VIEWPORT]);
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_renderer_get_viewport:
|
||||
* @renderer: a #GskRenderer
|
||||
* @viewport: (out caller-allocates): return location for the viewport rectangle
|
||||
*
|
||||
* Retrieves the viewport of the #GskRenderer.
|
||||
*
|
||||
* Since: 3.90
|
||||
*/
|
||||
void
|
||||
gsk_renderer_get_viewport (GskRenderer *renderer,
|
||||
graphene_rect_t *viewport)
|
||||
{
|
||||
GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer);
|
||||
|
||||
g_return_if_fail (GSK_IS_RENDERER (renderer));
|
||||
g_return_if_fail (viewport != NULL);
|
||||
|
||||
graphene_rect_init_from_rect (viewport, &priv->viewport);
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_renderer_get_window:
|
||||
* @renderer: a #GskRenderer
|
||||
|
@ -41,12 +41,6 @@ GType gsk_renderer_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
GskRenderer * gsk_renderer_new_for_window (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
void gsk_renderer_set_viewport (GskRenderer *renderer,
|
||||
const graphene_rect_t *viewport);
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
void gsk_renderer_get_viewport (GskRenderer *renderer,
|
||||
graphene_rect_t *viewport);
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
GdkWindow * gsk_renderer_get_window (GskRenderer *renderer);
|
||||
|
||||
|
@ -7123,14 +7123,6 @@ _gtk_window_set_allocation (GtkWindow *window,
|
||||
child_allocation.width = allocation->width;
|
||||
child_allocation.height = allocation->height;
|
||||
|
||||
if (priv->renderer != NULL)
|
||||
{
|
||||
graphene_rect_t viewport;
|
||||
|
||||
graphene_rect_init (&viewport, 0, 0, allocation->width, allocation->height);
|
||||
gsk_renderer_set_viewport (priv->renderer, &viewport);
|
||||
}
|
||||
|
||||
get_shadow_width (window, &window_border);
|
||||
|
||||
if (_gtk_widget_get_realized (widget))
|
||||
|
Loading…
Reference in New Issue
Block a user