nr-filter-tile.cpp revision 97380680e1fb13807051ace522363ee6a3d503d8
/*
* feTile filter primitive renderer
*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h>
#include "display/cairo-utils.h"
#include "display/nr-filter-tile.h"
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
namespace Inkscape {
namespace Filters {
{
}
return new FilterTile();
}
FilterTile::~FilterTile()
{}
{
// FIX ME!
static bool tile_warning = false;
if (!tile_warning) {
g_warning("Renderer for feTile has non-optimal implementation, expect slowness and bugs.");
tile_warning = true;
}
// Fixing isn't so easy as the Inkscape renderer breaks the canvas into "rendering" tiles for
// faster rendering. (The "rendering" tiles are not the same as the tiles in this primitive.)
// Only if the the feTile tile source falls inside the current "rendering" tile will the tile
// image be available.
// This input source contains only the "rendering" tile.
// For debugging
// static int i = 0;
// ++i;
// std::stringstream filename;
// filename << "dump." << i << ".png";
// cairo_surface_write_to_png( in, filename.str().c_str() );
// This is the feTile source area as determined by the input primitive area (see SVG spec).
} else {
// color_interpolation_filters for out same as in.
// The rectangle of the "rendering" tile.
// Create feTile tile ----------------
// Get tile area in pixbuf units (tile transformed).
// Shift between "rendering" tile and feTile tile
// Create feTile tile surface
// Paint tiles ------------------
// For debugging
// std::stringstream filename;
// filename << "tile." << i << ".png";
// cairo_surface_write_to_png( tile, filename.str().c_str() );
// Determine number of feTile rows and columns
// Do tiling (TO DO: restrict to slot area.)
}
}
// Clean up
}
}
{
// Set to infinite rectangle so we get tile source. It will be clipped later.
}
{
return 1.0;
}
} /* namespace Filters */
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :