~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/libnr/nr-pixblock.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Authors:
7
7
 *   (C) 1999-2002 Lauris Kaplinski <lauris@kaplinski.com>
 
8
 *   2008, Jasper van de Gronde <th.v.d.gonde@hccnet.nl>
8
9
 *
9
10
 * This code is in the Public Domain
10
11
 */
213
214
 *
214
215
 * \return Pointer to fresh pixblock.
215
216
 * Calls g_new() and nr_pixblock_setup().
216
 
FIXME: currently unused, delete?
 
217
FIXME: currently unused, delete? JG: Should be used more often! (To simplify memory management.)
217
218
 */
218
219
NRPixBlock *
219
220
nr_pixblock_new (NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear)
221
222
        NRPixBlock *pb;
222
223
 
223
224
        pb = g_new (NRPixBlock, 1);
 
225
    if (!pb) return 0;
224
226
 
225
227
        nr_pixblock_setup (pb, mode, x0, y0, x1, y1, clear);
 
228
    if (pb->size!=NR_PIXBLOCK_SIZE_TINY && !pb->data.px) {
 
229
        g_free(pb);
 
230
        return 0;
 
231
    }
226
232
 
227
233
        return pb;
228
234
}
229
235
 
230
236
/**
 
237
 * Allocates NRPixBlock and sets it up.
 
238
 *
 
239
 * \return Pointer to fresh pixblock.
 
240
 * Calls g_new() and nr_pixblock_setup().
 
241
 */
 
242
NRPixBlock *
 
243
nr_pixblock_new_fast (NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear)
 
244
{
 
245
    NRPixBlock *pb;
 
246
 
 
247
    pb = g_new (NRPixBlock, 1);
 
248
    if (!pb) return 0;
 
249
 
 
250
    nr_pixblock_setup_fast (pb, mode, x0, y0, x1, y1, clear);
 
251
    if (pb->size!=NR_PIXBLOCK_SIZE_TINY && !pb->data.px) {
 
252
        g_free(pb);
 
253
        return 0;
 
254
    }
 
255
 
 
256
    return pb;
 
257
}
 
258
 
 
259
/**
231
260
 * Frees all memory taken by pixblock.
232
261
 *
233
262
 * \return NULL