colorstate: Add gdk_color_state_get_rendering_color_state()
Returns the linear color state that renderers should render in when this is the target color state. We disable this function unless linear compositing is enabled and just return @self by default.
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "gdkcolorstateprivate.h"
|
||||
|
||||
#include "gdkdebugprivate.h"
|
||||
|
||||
/**
|
||||
* GdkColorState:
|
||||
*
|
||||
@@ -165,6 +163,7 @@ GdkDefaultColorState gdk_default_color_states[] = {
|
||||
.klass = &GDK_DEFAULT_COLOR_STATE_CLASS,
|
||||
.ref_count = 0,
|
||||
.depth = GDK_MEMORY_U8,
|
||||
.rendering_color_state = GDK_COLOR_STATE_SRGB_LINEAR,
|
||||
},
|
||||
.name = "srgb",
|
||||
.no_srgb = GDK_COLOR_STATE_SRGB_LINEAR,
|
||||
@@ -174,6 +173,7 @@ GdkDefaultColorState gdk_default_color_states[] = {
|
||||
.klass = &GDK_DEFAULT_COLOR_STATE_CLASS,
|
||||
.ref_count = 0,
|
||||
.depth = GDK_MEMORY_U8,
|
||||
.rendering_color_state = GDK_COLOR_STATE_SRGB_LINEAR,
|
||||
},
|
||||
.name = "srgb-linear",
|
||||
.no_srgb = NULL,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "gdkcolorstate.h"
|
||||
|
||||
#include "gdkdebugprivate.h"
|
||||
#include "gdkmemoryformatprivate.h"
|
||||
|
||||
typedef enum
|
||||
@@ -19,6 +21,7 @@ struct _GdkColorState
|
||||
gatomicrefcount ref_count;
|
||||
|
||||
GdkMemoryDepth depth;
|
||||
GdkColorState *rendering_color_state;
|
||||
};
|
||||
|
||||
struct _GdkColorStateClass
|
||||
@@ -52,6 +55,15 @@ extern GdkDefaultColorState gdk_default_color_states[GDK_COLOR_STATE_N_IDS];
|
||||
const char * gdk_color_state_get_name (GdkColorState *color_state);
|
||||
GdkColorState * gdk_color_state_get_no_srgb_tf (GdkColorState *self);
|
||||
|
||||
static inline GdkColorState *
|
||||
gdk_color_state_get_rendering_color_state (GdkColorState *self)
|
||||
{
|
||||
if (!GDK_DEBUG_CHECK (LINEAR))
|
||||
return self;
|
||||
|
||||
return self->rendering_color_state;
|
||||
}
|
||||
|
||||
static inline GdkMemoryDepth
|
||||
gdk_color_state_get_depth (GdkColorState *self)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user