summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fff1a66)
raw | patch | inline | side by side (parent: fff1a66)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 26 Oct 2006 06:55:45 +0000 (06:55 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 26 Oct 2006 06:55:45 +0000 (06:55 +0000) |
src/display/sp-canvas.cpp | patch | blob | history | |
src/display/sp-canvas.h | patch | blob | history |
index 6bd88613240b22fc6ab08be4ba64e8e08cbda1b1..f258d5370525d3c377a0b042c521d17cb3fc67fe 100644 (file)
canvas->redraw_count = 0;
canvas->forced_redraw_count = 0;
- canvas->forced_redraw_limit = 0;
+ canvas->forced_redraw_limit = -1;
canvas->slowest_buffer = 0;
}
@@ -1664,7 +1664,7 @@ sp_canvas_paint_rect_internal (SPCanvas *canvas, NRRectL *rect, NR::ICoord *x_ab
// only if we're drawing multiple buffers, and only if this one was not very fast,
// and only if we're allowed to interrupt this redraw
bool ok_to_interrupt = (multiple_buffers && this_buffer > 25000);
- if (ok_to_interrupt && canvas->forced_redraw_limit) {
+ if (ok_to_interrupt && (canvas->forced_redraw_limit != -1)) {
ok_to_interrupt = (canvas->forced_redraw_count < canvas->forced_redraw_limit);
}
@@ -1679,6 +1679,9 @@ sp_canvas_paint_rect_internal (SPCanvas *canvas, NRRectL *rect, NR::ICoord *x_ab
// If one of the iterations has redrawn by itself, abort
if (this_count != canvas->redraw_count) {
canvas->slowest_buffer = slowest_buffer;
+ if (canvas->forced_redraw_limit != -1) {
+ canvas->forced_redraw_count++;
+ }
return 1; // interrupted
}
}
@@ -1687,7 +1690,7 @@ sp_canvas_paint_rect_internal (SPCanvas *canvas, NRRectL *rect, NR::ICoord *x_ab
// if so, force update and abort
if (canvas->need_redraw || canvas->need_update) {
canvas->slowest_buffer = slowest_buffer;
- if (canvas->forced_redraw_limit) {
+ if (canvas->forced_redraw_limit != -1) {
canvas->forced_redraw_count++;
}
do_update (canvas);
}
// we've had a full unaborted redraw, reset the full redraw counter
- if (canvas->forced_redraw_limit) {
+ if (canvas->forced_redraw_limit != -1) {
canvas->forced_redraw_count = 0;
}
}
sp_canvas_end_forced_full_redraws(SPCanvas *canvas) {
g_return_if_fail(canvas != NULL);
- canvas->forced_redraw_limit = 0;
+ canvas->forced_redraw_limit = -1;
}
/**
index ebc9845f38feea4fff8b96cc284b243cbfe93936..39a7ae1f82e15093a401ceb3ae19c5e13fd70633 100644 (file)
--- a/src/display/sp-canvas.h
+++ b/src/display/sp-canvas.h
long redraw_count;
glong slowest_buffer;
- unsigned int forced_redraw_count;
- unsigned int forced_redraw_limit;
+ int forced_redraw_count;
+ int forced_redraw_limit;
/* For use by internal pick_current_item() function */
unsigned int left_grabbed_item : 1;