mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 21:40:19 +00:00
cairo: Use the draw context's color state
This just passes through the sRGB set by the GDK backends instead of hardcoding sRGB, so no functional changes.
This commit is contained in:
parent
6287eaa745
commit
4fa6f791f4
@ -25,6 +25,8 @@
|
|||||||
#include "gskdebugprivate.h"
|
#include "gskdebugprivate.h"
|
||||||
#include "gskrendererprivate.h"
|
#include "gskrendererprivate.h"
|
||||||
#include "gskrendernodeprivate.h"
|
#include "gskrendernodeprivate.h"
|
||||||
|
#include "gdk/gdkcolorstateprivate.h"
|
||||||
|
#include "gdk/gdkdrawcontextprivate.h"
|
||||||
#include "gdk/gdktextureprivate.h"
|
#include "gdk/gdktextureprivate.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -73,6 +75,7 @@ gsk_cairo_renderer_unrealize (GskRenderer *renderer)
|
|||||||
static void
|
static void
|
||||||
gsk_cairo_renderer_do_render (GskRenderer *renderer,
|
gsk_cairo_renderer_do_render (GskRenderer *renderer,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
|
GdkColorState *ccs,
|
||||||
GskRenderNode *root)
|
GskRenderNode *root)
|
||||||
{
|
{
|
||||||
GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer);
|
GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer);
|
||||||
@ -82,7 +85,7 @@ gsk_cairo_renderer_do_render (GskRenderer *renderer,
|
|||||||
profiler = gsk_renderer_get_profiler (renderer);
|
profiler = gsk_renderer_get_profiler (renderer);
|
||||||
gsk_profiler_timer_begin (profiler, self->profile_timers.cpu_time);
|
gsk_profiler_timer_begin (profiler, self->profile_timers.cpu_time);
|
||||||
|
|
||||||
gsk_render_node_draw (root, cr);
|
gsk_render_node_draw_with_color_state (root, cr, ccs);
|
||||||
|
|
||||||
cpu_time = gsk_profiler_timer_end (profiler, self->profile_timers.cpu_time);
|
cpu_time = gsk_profiler_timer_end (profiler, self->profile_timers.cpu_time);
|
||||||
gsk_profiler_timer_set (profiler, self->profile_timers.cpu_time, cpu_time);
|
gsk_profiler_timer_set (profiler, self->profile_timers.cpu_time, cpu_time);
|
||||||
@ -140,7 +143,7 @@ gsk_cairo_renderer_render_texture (GskRenderer *renderer,
|
|||||||
|
|
||||||
cairo_translate (cr, - viewport->origin.x, - viewport->origin.y);
|
cairo_translate (cr, - viewport->origin.x, - viewport->origin.y);
|
||||||
|
|
||||||
gsk_cairo_renderer_do_render (renderer, cr, root);
|
gsk_cairo_renderer_do_render (renderer, cr, GDK_COLOR_STATE_SRGB, root);
|
||||||
|
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
|
||||||
@ -178,7 +181,10 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
gsk_cairo_renderer_do_render (renderer, cr, root);
|
gsk_cairo_renderer_do_render (renderer,
|
||||||
|
cr,
|
||||||
|
gdk_draw_context_get_color_state (GDK_DRAW_CONTEXT (self->cairo_context)),
|
||||||
|
root);
|
||||||
|
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user