mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 04:31:09 +00:00
gskcairo: Don't store the viewport in the global struct
Just query it locally.
This commit is contained in:
parent
d2622d93ad
commit
98086014d8
@ -18,8 +18,6 @@ struct _GskCairoRenderer
|
|||||||
{
|
{
|
||||||
GskRenderer parent_instance;
|
GskRenderer parent_instance;
|
||||||
|
|
||||||
graphene_rect_t viewport;
|
|
||||||
|
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
ProfileTimers profile_timers;
|
ProfileTimers profile_timers;
|
||||||
#endif
|
#endif
|
||||||
@ -52,6 +50,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
|
|||||||
{
|
{
|
||||||
GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer);
|
GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer);
|
||||||
GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer);
|
GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer);
|
||||||
|
graphene_rect_t viewport;
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
GskProfiler *profiler;
|
GskProfiler *profiler;
|
||||||
gint64 cpu_time;
|
gint64 cpu_time;
|
||||||
@ -63,17 +62,17 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
|
|||||||
|
|
||||||
g_return_if_fail (cr != NULL);
|
g_return_if_fail (cr != NULL);
|
||||||
|
|
||||||
gsk_renderer_get_viewport (renderer, &self->viewport);
|
gsk_renderer_get_viewport (renderer, &viewport);
|
||||||
|
|
||||||
if (GSK_RENDER_MODE_CHECK (GEOMETRY))
|
if (GSK_RENDER_MODE_CHECK (GEOMETRY))
|
||||||
{
|
{
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||||
cairo_rectangle (cr,
|
cairo_rectangle (cr,
|
||||||
self->viewport.origin.x,
|
viewport.origin.x,
|
||||||
self->viewport.origin.y,
|
viewport.origin.y,
|
||||||
self->viewport.size.width,
|
viewport.size.width,
|
||||||
self->viewport.size.height);
|
viewport.size.height);
|
||||||
cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5);
|
cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5);
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
Loading…
Reference in New Issue
Block a user