34#include <pango/pangocairo.h>
56 cairo_rectangle(cr, -border * .5f, -border * .5f,
width + border,
height + border);
57 cairo_set_source_rgb(cr, 1., 1., 1.);
66 cairo_set_source_rgba(cri, 0.5, 0.5, 0.5, 0.5);
70 pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
71 layout = pango_cairo_create_layout(cri);
73 pango_layout_set_font_description(layout, desc);
74 pango_layout_set_text(layout, label, -1);
75 pango_layout_get_pixel_extents(layout, &ink, NULL);
76 cairo_move_to(cri, ink.height * 2,
height - (ink.height * 3));
77 pango_cairo_layout_path(cri, layout);
78 cairo_set_source_rgb(cri, 0.7, 0.7, 0.7);
79 cairo_fill_preserve(cri);
80 cairo_set_line_width(cri, 0.7);
81 cairo_set_source_rgb(cri, 0.3, 0.3, 0.3);
83 pango_font_description_free(desc);
84 g_object_unref(layout);
93 cairo_surface_destroy(locked->
surface);
100 locked->
entry = NULL;
116 gboolean keep_previous_on_fail)
129 void *live_data = NULL;
133 && live_entry == locked->
entry && live_data == locked->
data)
159 const int stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24,
width);
160 const size_t required_size = (size_t)stride * (
size_t)
height;
178 locked->
entry = entry;
183 cairo_surface_t *surface = cairo_image_surface_create_for_data(
data, CAIRO_FORMAT_RGB24,
width,
height, stride);
184 if(
IS_NULL_PTR(surface) || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS)
186 if(!
IS_NULL_PTR(surface)) cairo_surface_destroy(surface);
197 locked->
entry = entry;
203 const int width,
const int height,
const int border,
209 cairo_set_source_rgb(cr, bg_color[0], bg_color[1], bg_color[2]);
212 int wd = locked->
width;
214 if(wd <= 0 || ht <= 0)
return FALSE;
218 cairo_translate(cr, .5f * (
width - wd), .5f * (
height - ht));
224 cairo_rectangle(cr, 0, 0, wd, ht);
225 cairo_set_source_surface(cr, locked->
surface, 0, 0);
235 gboolean keep_previous_on_fail)
static dt_aligned_pixel_t XYZ
static dt_aligned_pixel_t Lab
static dt_aligned_pixel_t RGB
int dt_conf_get_int(const char *name)
void dt_control_queue_redraw_center()
request redraw of center window. This redraws the center view within a gdk critical section to preven...
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
void dt_dev_draw_iso12646_border(cairo_t *cr, double width, double height, int border)
gboolean dt_dev_lock_pipe_surface(dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, dt_dev_locked_surface_t *locked, dt_dev_pixelpipe_cache_wait_t *wait, const char *wait_owner_tag, gboolean keep_previous_on_fail)
gboolean dt_dev_render_locked_surface(cairo_t *cr, const dt_develop_t *dev, dt_dev_locked_surface_t *locked, const int width, const int height, const int border, const dt_aligned_pixel_t bg_color)
static void _colormanage_ui_color(const float L, const float a, const float b, dt_aligned_pixel_t RGB)
gboolean dt_dev_paint_main_backbuf(dt_dev_locked_surface_t *locked, dt_dev_pixelpipe_cache_wait_t *wait, const char *wait_owner_tag, cairo_t *cr, dt_develop_t *dev, int width, int height, int border, const dt_aligned_pixel_t bg_color, gboolean keep_previous_on_fail)
void dt_dev_get_background_color(const dt_develop_t *dev, dt_aligned_pixel_t bg_color)
static void _dev_backbuf_restart_cache_wait(gpointer user_data)
void dt_dev_release_locked_surface(dt_dev_locked_surface_t *locked)
void dt_dev_draw_profile_mode_label(cairo_t *cri, int height)
void dt_dev_pixelpipe_cache_wait_set_owner(dt_dev_pixelpipe_cache_wait_t *wait, const char *owner_tag, gpointer owner_object)
Attach debug ownership metadata to one cache wait request.
gboolean dt_dev_pixelpipe_cache_peek_gui(dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, void **data, dt_pixel_cache_entry_t **cache_entry, dt_dev_pixelpipe_cache_wait_t *wait, dt_dev_pixelpipe_cache_ready_callback_t restart, gpointer restart_data)
#define DT_PIXEL_APPLY_DPI(value)
float dt_aligned_pixel_t[4]
void * dt_pixel_cache_entry_get_data(dt_pixel_cache_entry_t *entry)
size_t dt_pixel_cache_entry_get_size(dt_pixel_cache_entry_t *entry)
Peek the size (in bytes) reserved for the host buffer of a cache entry.
void dt_dev_pixelpipe_cache_rdlock_entry(dt_dev_pixelpipe_cache_t *cache, gboolean lock, dt_pixel_cache_entry_t *cache_entry)
Lock or release the read lock on the entry.
Pixelpipe cache for storing intermediate results in the pixelpipe.
#define DT_PIXELPIPE_CACHE_HASH_INVALID
static uint64_t dt_dev_backbuf_get_hash(const dt_backbuf_t *backbuf)
unsigned __int64 uint64_t
struct dt_dev_pixelpipe_cache_t * pixelpipe_cache
struct dt_gui_gtk_t * gui
struct dt_colorspaces_t * color_profiles
struct dt_bauhaus_t * bauhaus
PangoFontDescription * pango_font_desc
cmsHTRANSFORM transform_xyz_to_display
dt_colorspaces_color_mode_t mode
struct dt_pixel_cache_entry_t * entry
cairo_surface_t * surface
dt_dev_pixelpipe_type_t type
struct dt_develop_t::@26 iso_12646
struct dt_dev_pixelpipe_t * pipe
void dt_supervisor_widget(const dt_sv_op_t op, const char *widget_tag, const uint64_t consumed_hash, const int pipe_type, const int32_t imgid)
static gboolean dt_supervisor_active(void)