diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 03e4de86e18b97205555bf6975ce97209a48d6e0..85770640a31c9b765ffe62fb9ec0fc0b34fe724d 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -983,9 +983,7 @@ static void sp_canvas_init(SPCanvas *canvas) canvas->_drawing_disabled = false; canvas->_backing_store = nullptr; -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) canvas->_surface_for_similar = nullptr; -#endif canvas->_clean_region = cairo_region_create(); canvas->_background = cairo_pattern_create_rgb(1, 1, 1); canvas->_background_is_checkerboard = false; @@ -1054,12 +1052,10 @@ void SPCanvas::dispose(GObject *object) cairo_surface_destroy(canvas->_backing_store); canvas->_backing_store = nullptr; } -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) if (canvas->_surface_for_similar) { cairo_surface_destroy(canvas->_surface_for_similar); canvas->_surface_for_similar = nullptr; } -#endif if (canvas->_clean_region) { cairo_region_destroy(canvas->_clean_region); canvas->_clean_region = nullptr; @@ -1184,7 +1180,6 @@ void SPCanvas::handle_size_allocate(GtkWidget *widget, GtkAllocation *allocation // Resize backing store. cairo_surface_t *new_backing_store = nullptr; -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) if (canvas->_surface_for_similar != nullptr) { // Size in device pixels. Does not set device scale. @@ -1194,7 +1189,6 @@ void SPCanvas::handle_size_allocate(GtkWidget *widget, GtkAllocation *allocation allocation->width * canvas->_device_scale, allocation->height * canvas->_device_scale); } -#endif if (new_backing_store == nullptr) { // Size in device pixels. Does not set device scale. @@ -2261,7 +2255,6 @@ gboolean SPCanvas::handle_draw(GtkWidget *widget, cairo_t *cr) { SPCanvas *canvas = SP_CANVAS(widget); -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) if (canvas->_surface_for_similar == nullptr && canvas->_backing_store != nullptr) { // Device scale is copied but since this is only created one time, we'll @@ -2295,7 +2288,6 @@ gboolean SPCanvas::handle_draw(GtkWidget *widget, cairo_t *cr) { cairo_surface_destroy(canvas->_backing_store); canvas->_backing_store = new_backing_store; } -#endif // Blit from the backing store, without regard for the clean region. // This is necessary because GTK clears the widget for us, which causes @@ -2681,7 +2673,6 @@ void SPCanvas::scrollTo( Geom::Point const &c, unsigned int clear, bool is_scrol assert(_backing_store); // this cairo operation is slow, improvements welcome cairo_surface_t *new_backing_store = nullptr; -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) if (_surface_for_similar != nullptr) // Size in device pixels. Does not set device scale. @@ -2690,7 +2681,6 @@ void SPCanvas::scrollTo( Geom::Point const &c, unsigned int clear, bool is_scrol CAIRO_FORMAT_ARGB32, allocation.width * _device_scale, allocation.height * _device_scale); -#endif if (new_backing_store == nullptr) // Size in device pixels. Does not set device scale. new_backing_store = diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index 9c78794424acd713f4ce1825f802d93ab58fd662..5349ec144aaaa83e13e82415e456602a8d348aca 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -215,10 +215,8 @@ public: /// Image surface storing the contents of the widget cairo_surface_t *_backing_store; -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) /// This should be e.g. a cairo-xlib surface that is used to allocate _backing_store; might be NULL. cairo_surface_t *_surface_for_similar; -#endif /// Area of the widget that has up-to-date content cairo_region_t *_clean_region; /// Widget background, defaults to white diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 4d02ec3e342f5896ac0f0ea2298be2d8088f6d03..d0a18d639c4e5530b487a24444395ddfce877b89 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -801,13 +801,6 @@ CairoRenderContext::setupSurface(double width, double height) _width = width; _height = height; - Inkscape::SVGOStringStream os_bbox; - Inkscape::SVGOStringStream os_pagebbox; - os_bbox.setf(std::ios::fixed); // don't use scientific notation - os_pagebbox.setf(std::ios::fixed); // don't use scientific notation - os_bbox << "%%BoundingBox: 0 0 " << (int)ceil(width) << (int)ceil(height); // apparently, the numbers should be integers. (see bug 380501) - os_pagebbox << "%%PageBoundingBox: 0 0 " << (int)ceil(width) << (int)ceil(height); - cairo_surface_t *surface = nullptr; cairo_matrix_t ctm; cairo_matrix_init_identity (&ctm); @@ -829,12 +822,6 @@ CairoRenderContext::setupSurface(double width, double height) } cairo_ps_surface_restrict_to_level(surface, (cairo_ps_level_t)_ps_level); cairo_ps_surface_set_eps(surface, (cairo_bool_t) _eps); - // Cairo calculates the bounding box itself, however we want to override this. See Launchpad bug #380501 -#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)) -// cairo_ps_dsc_comment(surface, os_bbox.str().c_str()); -// cairo_ps_dsc_begin_page(surface); -// cairo_ps_dsc_comment(surface, os_pagebbox.str().c_str()); -#endif break; #endif default: diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index cd46a66dd6b26c91391d6f4c4f0ad63223a7cf9d..7ad308ccdb02f6d220a769f812b09c9ec0615aa1 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -243,9 +243,7 @@ CairoRendererPdfOutput::init () "Portable Document Format\n" "org.inkscape.output.pdf.cairorenderer\n" "\n" -#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)) "\n" -#endif "\n" "\n" "\n" diff --git a/src/object/sp-mesh-gradient.cpp b/src/object/sp-mesh-gradient.cpp index cf693f774d7610df98d1aaddb9d1396b3fb91db3..89b5d08311916b20d13d8b09daed87625a225d54 100644 --- a/src/object/sp-mesh-gradient.cpp +++ b/src/object/sp-mesh-gradient.cpp @@ -154,14 +154,8 @@ Inkscape::XML::Node* SPMeshGradient::write(Inkscape::XML::Document *xml_doc, Ink } cairo_pattern_t* SPMeshGradient::pattern_new(cairo_t * /*ct*/, -#if defined(MESH_DEBUG) || (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 4)) - Geom::OptRect const &bbox, - double opacity -#else - Geom::OptRect const & /*bbox*/, - double /*opacity*/ -#endif - ) + Geom::OptRect const &bbox, + double opacity) { using Geom::X; using Geom::Y; @@ -174,7 +168,6 @@ cairo_pattern_t* SPMeshGradient::pattern_new(cairo_t * /*ct*/, cairo_pattern_t *cp = nullptr; -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 4) SPMeshNodeArray* my_array = &array; if( type_set ) { @@ -266,15 +259,6 @@ cairo_pattern_t* SPMeshGradient::pattern_new(cairo_t * /*ct*/, } ink_cairo_pattern_set_matrix(cp, gs2user.inverse()); -#else - static bool shown = false; - if( !shown ) { - std::cout << "sp_mesh_create_pattern: needs cairo >= 1.11.4, using " - << cairo_version_string() << std::endl; - shown = true; - } -#endif - /* cairo_pattern_t *cp = cairo_pattern_create_radial( rg->fx.computed, rg->fy.computed, 0,