summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-08-08 17:27:51 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-08-08 17:27:51 +0000
commit60d3113d1f022a3de7cf04c7979d4751b3fe21f6 (patch)
treeca33e2a9a1af6b5911598fa1c6a1d77087b71dd2 /src/display
parentMinor cleanups (diff)
parentAdd a constrained snap method that takes multiple constraints. This reduces t... (diff)
downloadinkscape-60d3113d1f022a3de7cf04c7979d4751b3fe21f6.tar.gz
inkscape-60d3113d1f022a3de7cf04c7979d4751b3fe21f6.zip
merge from trunk
(bzr r9508.1.52)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/nr-arena-item.cpp10
-rw-r--r--src/display/nr-arena-item.h2
-rw-r--r--src/display/nr-filter-gaussian.cpp3
-rw-r--r--src/display/snap-indicator.cpp31
-rw-r--r--src/display/sp-canvas.cpp5
-rw-r--r--src/display/sp-canvas.h3
6 files changed, 27 insertions, 27 deletions
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index 9f3863f4d..d9c04ae95 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -331,8 +331,11 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
if (!ct) return item->state;
#ifdef NR_ARENA_ITEM_VERBOSE
- printf ("Invoke render %p: %d %d - %d %d\n", item, area->x0, area->y0,
- area->x1, area->y1);
+ g_message ("Invoke render %p on %p: %d %d - %d %d, %d %d - %d %d", item, pb,
+ area->x0, area->y0,
+ area->x1, area->y1,
+ item->drawbox.x0, item->drawbox.y0,
+ item->drawbox.x1, item->drawbox.y1);
#endif
/* If we are invisible, just return successfully */
@@ -487,6 +490,7 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
cairo_pattern_set_matrix(cmask, &m);
cairo_mask(ct, cmask);
// opacity of masked objects is handled by premultiplying the mask
+
} else {
// opacity of non-masked objects must be rendered explicitly
if (needs_opacity) {
@@ -763,7 +767,7 @@ nr_arena_item_set_item_bbox (NRArenaItem *item, Geom::OptRect &bbox)
/** Returns a background image for use with filter effects. */
NRPixBlock *
-nr_arena_item_get_background (NRArenaItem const *item, int depth)
+nr_arena_item_get_background (NRArenaItem const *item)
{
return NULL;
}
diff --git a/src/display/nr-arena-item.h b/src/display/nr-arena-item.h
index 752390776..6aa7f9752 100644
--- a/src/display/nr-arena-item.h
+++ b/src/display/nr-arena-item.h
@@ -171,7 +171,7 @@ void nr_arena_item_set_mask (NRArenaItem *item, NRArenaItem *mask);
void nr_arena_item_set_order (NRArenaItem *item, int order);
void nr_arena_item_set_item_bbox (NRArenaItem *item, Geom::OptRect &bbox);
-NRPixBlock *nr_arena_item_get_background (NRArenaItem const *item, int depth = 0);
+NRPixBlock *nr_arena_item_get_background (NRArenaItem const *item);
/* Helpers */
diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp
index fbaa9eaa5..f8a483acb 100644
--- a/src/display/nr-filter-gaussian.cpp
+++ b/src/display/nr-filter-gaussian.cpp
@@ -551,7 +551,8 @@ void FilterGaussian::render_cairo(FilterSlot &slot)
}
#if HAVE_OPENMP
- int threads = Inkscape::Preferences::get()->getIntLimited("/options/threading/numthreads", omp_get_num_procs(), 1, 256);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ int threads = prefs->getIntLimited("/options/threading/numthreads", omp_get_num_procs(), 1, 256);
#else
int threads = 1;
#endif
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp
index fe5bd0371..c3198cd37 100644
--- a/src/display/snap-indicator.cpp
+++ b/src/display/snap-indicator.cpp
@@ -51,7 +51,6 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap
g_assert(_desktop != NULL);
if (!p.getSnapped()) {
- g_warning("No snapping took place, so no snap target will be displayed");
return; // If we haven't snapped, then it is of no use to draw a snapindicator
}
@@ -229,27 +228,15 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap
// Display the snap indicator (i.e. the cross)
SPCanvasItem * canvasitem = NULL;
- if (p.getTarget() == SNAPTARGET_NODE_SMOOTH || p.getTarget() == SNAPTARGET_NODE_CUSP) {
- canvasitem = sp_canvas_item_new(sp_desktop_tempgroup (_desktop),
- SP_TYPE_CTRL,
- "anchor", GTK_ANCHOR_CENTER,
- "size", 10.0,
- "stroked", TRUE,
- "stroke_color", pre_snap ? 0x7f7f7fff : 0xff0000ff,
- "mode", SP_KNOT_MODE_XOR,
- "shape", SP_KNOT_SHAPE_DIAMOND,
- NULL );
- } else {
- canvasitem = sp_canvas_item_new(sp_desktop_tempgroup (_desktop),
- SP_TYPE_CTRL,
- "anchor", GTK_ANCHOR_CENTER,
- "size", 10.0,
- "stroked", TRUE,
- "stroke_color", pre_snap ? 0x7f7f7fff : 0xff0000ff,
- "mode", SP_KNOT_MODE_XOR,
- "shape", SP_KNOT_SHAPE_CROSS,
- NULL );
- }
+ canvasitem = sp_canvas_item_new(sp_desktop_tempgroup (_desktop),
+ SP_TYPE_CTRL,
+ "anchor", GTK_ANCHOR_CENTER,
+ "size", 10.0,
+ "stroked", TRUE,
+ "stroke_color", pre_snap ? 0x7f7f7fff : 0xff0000ff,
+ "mode", SP_KNOT_MODE_XOR,
+ "shape", SP_KNOT_SHAPE_CROSS,
+ NULL );
const int timeout_val = 1200; // TODO add preference for snap indicator timeout?
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index bfd007cfe..fd3077adb 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1036,6 +1036,8 @@ sp_canvas_init (SPCanvas *canvas)
// See comment at in sp-canvas.h.
canvas->gen_all_enter_events = false;
+
+ canvas->drawing_disabled = false;
canvas->tiles=NULL;
canvas->tLeft=canvas->tTop=canvas->tRight=canvas->tBottom=0;
@@ -2138,6 +2140,9 @@ do_update (SPCanvas *canvas)
{
if (!canvas->root || !canvas->pixmap_gc) // canvas may have already be destroyed by closing desktop during interrupted display!
return TRUE;
+
+ if (canvas->drawing_disabled)
+ return TRUE;
/* Cause the update if necessary */
if (canvas->need_update) {
diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h
index 6a2ee074e..74476950f 100644
--- a/src/display/sp-canvas.h
+++ b/src/display/sp-canvas.h
@@ -180,6 +180,9 @@ struct SPCanvas {
// connector tool). If so, they may temporarily set this flag to
// 'true'.
bool gen_all_enter_events;
+
+ /* For scripting, sometimes we want to delay drawing. */
+ bool drawing_disabled;
int rendermode;