From c724e396729e2f2482b84bab8a8eee2b01cff987 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 20 Nov 2007 09:20:42 +0000 Subject: Display CMS adjustment per-desktop view (bzr r4114) --- src/display/sp-canvas.cpp | 9 +++++++-- src/display/sp-canvas.h | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 22 deletions(-) (limited to 'src/display') diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index efd262890..80b9103eb 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1022,6 +1022,11 @@ sp_canvas_init (SPCanvas *canvas) canvas->forced_redraw_count = 0; canvas->forced_redraw_limit = -1; +#if ENABLE_LCMS + canvas->enable_cms_display_adj = false; + canvas->cms_key = new Glib::ustring(""); +#endif // ENABLE_LCMS + canvas->is_scrolling = false; } @@ -1593,7 +1598,7 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1, if (buf.is_empty) { #if ENABLE_LCMS - if ( transf ) { + if ( transf && canvas->enable_cms_display_adj ) { cmsDoTransform( transf, &buf.bg_color, &buf.bg_color, 1 ); } #endif // ENABLE_LCMS @@ -1627,7 +1632,7 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1, */ #if ENABLE_LCMS - if ( transf ) { + if ( transf && canvas->enable_cms_display_adj ) { for ( gint yy = 0; yy < (y1 - y0); yy++ ) { guchar* p = buf.buf + (sw * 3) * yy; cmsDoTransform( transf, p, p, (x1 - x0) ); diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index 3b4c7743f..4b6d7b3b8 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -33,6 +33,8 @@ #include #include +#include + #include #include #include @@ -60,13 +62,13 @@ struct SPCanvasBuf{ }; /** - * An SPCanvasItem refers to a SPCanvas and to its parent item; it has + * An SPCanvasItem refers to a SPCanvas and to its parent item; it has * four coordinates, a bounding rectangle, and a transformation matrix. */ struct SPCanvasItem : public GtkObject { SPCanvas *canvas; SPCanvasItem *parent; - + double x1, y1, x2, y2; NR::Rect bounds; NR::Matrix xform; @@ -77,10 +79,10 @@ struct SPCanvasItem : public GtkObject { */ struct SPCanvasItemClass : public GtkObjectClass { void (* update) (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags); - + void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); double (* point) (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item); - + int (* event) (SPCanvasItem *item, GdkEvent *event); }; @@ -114,45 +116,45 @@ gint sp_canvas_item_order(SPCanvasItem * item); */ struct SPCanvas { GtkWidget widget; - + guint idle_id; - + SPCanvasItem *root; - + double dx0, dy0; int x0, y0; - + /* Area that needs redrawing, stored as a microtile array */ int tLeft,tTop,tRight,tBottom; int tileH,tileV; uint8_t *tiles; - + /* Last known modifier state, for deferred repick when a button is down */ int state; - + /* The item containing the mouse pointer, or NULL if none */ SPCanvasItem *current_item; - + /* Item that is about to become current (used to track deletions and such) */ SPCanvasItem *new_current_item; - + /* Item that holds a pointer grab, or NULL if none */ SPCanvasItem *grabbed_item; - + /* Event mask specified when grabbing an item */ guint grabbed_event_mask; - + /* If non-NULL, the currently focused item */ SPCanvasItem *focused_item; - + /* Event on which selection of current item is based */ GdkEvent pick_event; - + int close_enough; - + /* GC for temporary draw pixmap */ GdkGC *pixmap_gc; - + unsigned int need_update : 1; unsigned int need_redraw : 1; unsigned int need_repick : 1; @@ -172,11 +174,16 @@ struct SPCanvas { // connector tool). If so, they may temporarily set this flag to // 'true'. bool gen_all_enter_events; - + int rendermode; +#if ENABLE_LCMS + bool enable_cms_display_adj; + Glib::ustring* cms_key; +#endif // ENABLE_LCMS + bool is_scrolling; - + NR::Rect getViewbox() const; }; -- cgit v1.2.3