summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
Diffstat (limited to 'src/display')
-rw-r--r--src/display/nr-arena-glyphs.cpp17
-rw-r--r--src/display/nr-arena-shape.cpp35
-rw-r--r--src/display/nr-arena-shape.h8
-rw-r--r--src/display/nr-filter-specularlighting.cpp2
4 files changed, 27 insertions, 35 deletions
diff --git a/src/display/nr-arena-glyphs.cpp b/src/display/nr-arena-glyphs.cpp
index 3933625c3..243cf6618 100644
--- a/src/display/nr-arena-glyphs.cpp
+++ b/src/display/nr-arena-glyphs.cpp
@@ -503,11 +503,10 @@ nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPi
// In outline mode, render fill only, using outlinecolor
rgba = item->arena->outlinecolor;
} else if ( item->render_opacity ) {
- rgba = sp_color_get_rgba32_falpha(&style->fill.value.color,
- SP_SCALE24_TO_FLOAT(style->fill_opacity.value) *
- SP_SCALE24_TO_FLOAT(style->opacity.value));
+ rgba = style->fill.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->fill_opacity.value) *
+ SP_SCALE24_TO_FLOAT(style->opacity.value) );
} else {
- rgba = sp_color_get_rgba32_falpha(&style->fill.value.color, SP_SCALE24_TO_FLOAT(style->fill_opacity.value));
+ rgba = style->fill.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->fill_opacity.value) );
}
nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
pb->empty = FALSE;
@@ -528,7 +527,7 @@ nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPi
return (item->state);
}
- m.visible_area = pb->visible_area;
+ m.visible_area = pb->visible_area;
/* Render children stroke mask */
for (child = group->children; child != NULL; child = child->next) {
ret = nr_arena_glyphs_stroke_mask(NR_ARENA_GLYPHS(child), area, &m);
@@ -544,12 +543,10 @@ nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPi
}
} else if (style->stroke.isColor()) {
if ( item->render_opacity ) {
- rgba = sp_color_get_rgba32_falpha(&style->stroke.value.color,
- SP_SCALE24_TO_FLOAT(style->stroke_opacity.value) *
- SP_SCALE24_TO_FLOAT(style->opacity.value));
+ rgba = style->stroke.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->stroke_opacity.value) *
+ SP_SCALE24_TO_FLOAT(style->opacity.value) );
} else {
- rgba = sp_color_get_rgba32_falpha(&style->stroke.value.color,
- SP_SCALE24_TO_FLOAT(style->stroke_opacity.value));
+ rgba = style->stroke.value.color.toRGBA32( SP_SCALE24_TO_FLOAT(style->stroke_opacity.value) );
}
nr_blit_pixblock_mask_rgba32(pb, &m, rgba);
pb->empty = FALSE;
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
diff --git a/src/display/nr-arena-shape.h b/src/display/nr-arena-shape.h
index e6484de9f..9b4c846fe 100644
--- a/src/display/nr-arena-shape.h
+++ b/src/display/nr-arena-shape.h
@@ -38,9 +38,7 @@ struct NRArenaShape : public NRArenaItem {
SERVER
};
- Paint() : _type(NONE), _server(NULL) {
- sp_color_set_rgb_rgba32(&_color, 0);
- }
+ Paint() : _type(NONE), _color(0), _server(NULL) {}
Paint(Paint const &p) { _assign(p); }
~Paint() { clear(); }
@@ -60,7 +58,7 @@ struct NRArenaShape : public NRArenaItem {
void set(SPColor const &color) {
clear();
_type = COLOR;
- sp_color_copy(&_color, &color);
+ _color = color;
}
void set(SPPaintServer *server) {
clear();
@@ -86,7 +84,7 @@ struct NRArenaShape : public NRArenaItem {
void _assign(Paint const &p) {
_type = p._type;
_server = p._server;
- sp_color_copy(&_color, &p._color);
+ _color = p._color;
if (_server) {
sp_object_ref(_server, NULL);
}
diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp
index 565fa5e05..90d243a6b 100644
--- a/src/display/nr-filter-specularlighting.cpp
+++ b/src/display/nr-filter-specularlighting.cpp
@@ -47,7 +47,7 @@ FilterSpecularLighting::~FilterSpecularLighting()
//Investigating Phong Lighting model we should not take N.H but
//R.E which equals to 2*N.H^2 - 1
//replace the second line by
-//gdouble scal = scalar_product((N), (H)); scal = 2 * scal * scal - 1;\
+//gdouble scal = scalar_product((N), (H)); scal = 2 * scal * scal - 1;
//to get the expected formula
#define COMPUTE_INTER(inter, H, N, ks, speculaExponent) \
do {\