nr-arena-item.cpp revision 2f95b6ec60b75dcab7588ac0cd73dea9d62cf74e
#define __NR_ARENA_ITEM_C__
/*
* RGBA display list system for inkscape
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#define noNR_ARENA_ITEM_VERBOSE
#define noNR_ARENA_ITEM_DEBUG_CASCADE
#include <libnr/nr-pixops.h>
#include "nr-arena.h"
#include "nr-arena-item.h"
#include "gc-core.h"
#include "nr-filter.h"
#include "nr-arena-group.h"
#include "prefs-utils.h"
static NRObjectClass *parent_class;
nr_arena_item_get_type (void)
{
if (!type) {
"NRArenaItem",
sizeof (NRArenaItemClass),
sizeof (NRArenaItem),
(void (*)(NRObjectClass *))
(void (*)(NRObject *))
}
return type;
}
static void
{
}
static void
{
item->background_new = false;
}
static void
{
}
{
return NULL;
}
{
} else {
if (ref)
return ref;
}
}
void
{
}
void
{
}
void
{
}
{
return item;
}
{
return NULL;
}
unsigned int
{
#ifdef NR_ARENA_ITEM_DEBUG_CASCADE
printf ("Update %s:%p %x %x %x\n",
#endif
/* return if in error */
/* Set reset flags according to propagation status */
}
/* Reset our state */
/* Return if NOP */
/* Test whether to return immediately */
}
/* Reset image cache, if not to be kept */
}
/* Set up local gc */
}
/* Remember the transformation matrix */
/* Invoke the real method */
reset);
/* Enlarge the bounding box to contain filter effects */
}
/* Clipping */
if (newstate & NR_ARENA_ITEM_STATE_INVALID) {
}
}
/* Masking */
if (newstate & NR_ARENA_ITEM_STATE_INVALID) {
}
}
}
/**
* Render item to pixblock.
*
* \return Has NR_ARENA_ITEM_STATE_RENDER set on success.
*/
unsigned int
{
#ifdef NR_ARENA_ITEM_VERBOSE
#endif
/* If we are outside bbox just return successfully */
if (nr_rect_l_test_empty (&carea))
}
/* Has cache pixblock, render this and return */
/* fixme: This probably cannot overflow, because we render only if visible */
/* fixme: and pixel cache is there only for small items */
/* fixme: But this still needs extra check (Lauris) */
FALSE);
}
/* Setup cache if we can */
if ((!(flags & NR_ARENA_ITEM_RENDER_NO_CACHE)) &&
// Item bbox is fully in renderable area and size is acceptable
// Set nocache flag for downstream rendering
}
/* Determine, whether we need temporary buffer */
/* Setup and render item buffer */
TRUE);
// if memory allocation failed, abort render
}
/* If background access is used, save the pixblock address.
* This address is set to NULL at the end of this block */
if (item->background_new
}
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
}
/* Run filtering, if a filter is set for this object */
}
/* Setup mask pixblock */
/* Do clip if needed */
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
}
}
/* Do mask if needed */
/* Set up yet another temporary pixblock */
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
}
/* Composite with clip */
int x, y;
unsigned char *s, *d;
s = NR_PIXBLOCK_PX (&tpb) + (y -
d = NR_PIXBLOCK_PX (&mpb) + (y -
unsigned int m;
d[0] =
(NR_PREMUL_123 (d[0], m));
s += 4;
d += 1;
}
}
} else {
int x, y;
unsigned char *s, *d;
s = NR_PIXBLOCK_PX (&tpb) + (y -
d = NR_PIXBLOCK_PX (&mpb) + (y -
unsigned int m;
s += 4;
d += 1;
}
}
}
}
}
/* Multiply with opacity if needed */
&& !outline) {
int x, y;
unsigned int a;
unsigned char *d;
d[0] = NR_PREMUL_111 (d[0], a);
d += 1;
}
}
}
/* Compose rendering pixblock int destination */
}
/* This pointer wouldn't be valid outside this block, so clear it */
} else {
/* Opacity only */
}
} else {
/* Just render */
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
}
}
/* Have to blit from cache */
}
}
unsigned int
{
/* we originally short-circuited if the object state included
* NR_ARENA_ITEM_STATE_CLIP (and showed a warning on the console);
* anyone know why we stopped doing so?
*/
#ifdef NR_ARENA_ITEM_VERBOSE
printf ("Invoke clip by %p: %d %d - %d %d, item bbox %d %d - %d %d\n",
#endif
/* Need render that item */
}
}
}
unsigned int sticky)
{
// Sometimes there's no BBOX in item->state, reason unknown (bug 992817); I made this not an assert to remove the warning
return NULL;
return NULL;
// TODO: rewrite using NR::Rect
const double x = p[NR::X];
const double y = p[NR::Y];
}
return NULL;
}
void
unsigned int propagate)
{
} else {
}
}
}
void
{
}
/* Public */
{
}
return NULL;
}
void
{
}
void
{
nr_arena_item_set_transform (item, &t);
}
void
{
return;
/* Set to identity affine */
} else {
}
}
}
void
{
}
void
{
}
void
{
}
void
{
if (clip)
}
}
void
{
if (mask)
}
}
void
{
return;
int pos = 0;
break;
pos += 1;
}
}
}
/** Returns a background image for use with filter effects. */
{
NRPixBlock *pb;
if (!item->background_pb)
return NULL;
if (item->background_new) {
pb = new NRPixBlock ();
return NULL;
} else
return NULL;
if (depth > 0)
return pb;
}
/* Helpers */
{
if (prev)
if (next)
return child;
}
{
if (prev)
if (next)
return next;
}
/*
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:encoding=utf-8:textwidth=99 :