summaryrefslogtreecommitdiffstats
path: root/src/display/nr-arena-shape.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2007-09-15 16:37:27 +0000
committerjoncruz <joncruz@users.sourceforge.net>2007-09-15 16:37:27 +0000
commitc13edab979886a7dc0a23e8bf8b5da77fb5676de (patch)
treed0af3cb43043747680e49269441978694656e6f8 /src/display/nr-arena-shape.cpp
parentavoid code duplication, i.e. use sp_item_snappoints in the object-snapper.cpp (diff)
downloadinkscape-c13edab979886a7dc0a23e8bf8b5da77fb5676de.tar.gz
inkscape-c13edab979886a7dc0a23e8bf8b5da77fb5676de.zip
Refactoring SPColor to C++ and removing legacy CMYK implementation
(bzr r3753)
Diffstat (limited to 'src/display/nr-arena-shape.cpp')
-rw-r--r--src/display/nr-arena-shape.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp
index d245e3928..9150b419f 100644
--- a/src/display/nr-arena-shape.cpp
+++ b/src/display/nr-arena-shape.cpp
@@ -770,17 +770,15 @@ cairo_arena_shape_render_stroke(NRArenaItem *item, NRRectL *area, NRPixBlock *pb
cairo_t *ct = nr_create_cairo_context (area, pb);
- if (!ct)
+ if (!ct)
return;
guint32 rgba;
if ( item->render_opacity ) {
- rgba = sp_color_get_rgba32_falpha(&shape->_stroke.paint.color(),
- shape->_stroke.opacity *
- SP_SCALE24_TO_FLOAT(style->opacity.value));
+ rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity *
+ SP_SCALE24_TO_FLOAT(style->opacity.value) );
} else {
- rgba = sp_color_get_rgba32_falpha(&shape->_stroke.paint.color(),
- shape->_stroke.opacity);
+ rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity );
}
// FIXME: we use RGBA buffers but cairo writes BGRA (on i386), so we must cheat
@@ -897,7 +895,7 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
return (item->state);
}
- m.visible_area = pb->visible_area;
+ m.visible_area = pb->visible_area;
nr_pixblock_render_shape_mask_or(m,shape->fill_shp);
m.empty = FALSE;
@@ -905,12 +903,10 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
// do not render fill in any way
} else if (shape->_fill.paint.type() == NRArenaShape::Paint::COLOR) {
if ( item->render_opacity ) {
- rgba = sp_color_get_rgba32_falpha(&shape->_fill.paint.color(),
- shape->_fill.opacity *
- SP_SCALE24_TO_FLOAT(style->opacity.value));
+ rgba = shape->_fill.paint.color().toRGBA32( shape->_fill.opacity *
+ SP_SCALE24_TO_FLOAT(style->opacity.value) );
} else {
- rgba = sp_color_get_rgba32_falpha(&shape->_fill.paint.color(),
- shape->_fill.opacity);
+ rgba = shape->_fill.paint.color().toRGBA32( shape->_fill.opacity );
}
nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
pb->empty = FALSE;
@@ -938,17 +934,15 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
return (item->state);
}
- m.visible_area = pb->visible_area;
+ m.visible_area = pb->visible_area;
nr_pixblock_render_shape_mask_or(m, shape->stroke_shp);
m.empty = FALSE;
if ( item->render_opacity ) {
- rgba = sp_color_get_rgba32_falpha(&shape->_stroke.paint.color(),
- shape->_stroke.opacity *
- SP_SCALE24_TO_FLOAT(style->opacity.value));
+ rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity *
+ SP_SCALE24_TO_FLOAT(style->opacity.value) );
} else {
- rgba = sp_color_get_rgba32_falpha(&shape->_stroke.paint.color(),
- shape->_stroke.opacity);
+ rgba = shape->_stroke.paint.color().toRGBA32( shape->_stroke.opacity );
}
nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
pb->empty = FALSE;
@@ -992,6 +986,8 @@ nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock
// cairo clipping: this basically works except for the stride-must-be-divisible-by-4 cairo bug;
// reenable this when the bug is fixed and remove the rest of this function
+// TODO
+#if defined(DEADCODE) && !defined(DEADCODE)
static guint
cairo_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb)
{
@@ -1000,7 +996,7 @@ cairo_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb)
cairo_t *ct = nr_create_cairo_context (area, pb);
- if (!ct)
+ if (!ct)
return item->state;
cairo_set_source_rgba(ct, 0, 0, 0, 1);
@@ -1020,6 +1016,7 @@ cairo_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb)
return item->state;
}
+#endif //defined(DEADCODE) && !defined(DEADCODE)
static guint