summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-08-01 09:04:51 +0000
committertavmjong-free <tavmjong@free.fr>2014-08-01 09:04:51 +0000
commit97a4ef4fd8b0c841a90f3bb29dee13fd96edecb7 (patch)
treec88c8e7ef5b19447167bce4c8e5f590e27722a25
parentBasic support for <solidColor> element (rendering only as a paint server). (diff)
downloadinkscape-97a4ef4fd8b0c841a90f3bb29dee13fd96edecb7.tar.gz
inkscape-97a4ef4fd8b0c841a90f3bb29dee13fd96edecb7.zip
Rename 'blend-mode' property to 'mix-blend-mode' per CSS spec.
(bzr r13485)
-rw-r--r--src/attributes.cpp2
-rw-r--r--src/attributes.h2
-rw-r--r--src/display/drawing-item.cpp14
-rw-r--r--src/display/drawing-item.h2
-rw-r--r--src/sp-item.cpp4
-rw-r--r--src/style.cpp10
-rw-r--r--src/style.h3
7 files changed, 18 insertions, 19 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp
index da7b25f03..fec5d3af4 100644
--- a/src/attributes.cpp
+++ b/src/attributes.cpp
@@ -440,7 +440,7 @@ static SPStyleProp const props[] = {
{SP_PROP_DISPLAY, "display"},
{SP_PROP_OVERFLOW, "overflow"},
{SP_PROP_VISIBILITY, "visibility"},
- {SP_PROP_BLEND_MODE, "mix-blend-mode"}, // CSS Blending and Compositing
+ {SP_PROP_MIX_BLEND_MODE, "mix-blend-mode"}, // CSS Blending and Compositing
{SP_PROP_ISOLATION, "isolation"},
/* SVG */
/* Clip/Mask */
diff --git a/src/attributes.h b/src/attributes.h
index 82e7ca8a6..3397e4034 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -441,7 +441,7 @@ enum SPAttributeEnum {
SP_PROP_DISPLAY,
SP_PROP_OVERFLOW,
SP_PROP_VISIBILITY,
- SP_PROP_BLEND_MODE,
+ SP_PROP_MIX_BLEND_MODE,
SP_PROP_ISOLATION,
/* SVG */
/* Clip/Mask */
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index 0bfb00b62..80eb69546 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -127,7 +127,7 @@ DrawingItem::DrawingItem(Drawing &drawing)
, _pick_children(0)
, _antialias(1)
, _isolation(SP_CSS_ISOLATION_AUTO)
- , _blend_mode(SP_CSS_BLEND_NORMAL)
+ , _mix_blend_mode(SP_CSS_BLEND_NORMAL)
{}
DrawingItem::~DrawingItem()
@@ -291,10 +291,10 @@ DrawingItem::setIsolation(unsigned isolation)
}
void
-DrawingItem::setBlendMode(unsigned blend_mode)
+DrawingItem::setBlendMode(unsigned mix_blend_mode)
{
- _blend_mode = blend_mode;
- //if( blend_mode != 0 ) std::cout << "setBlendMode: " << blend_mode << std::endl;
+ _mix_blend_mode = mix_blend_mode;
+ //if( mix_blend_mode != 0 ) std::cout << "setBlendMode: " << mix_blend_mode << std::endl;
_markForRendering();
}
@@ -592,7 +592,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
if (_cached) {
if (_cache) {
_cache->prepare();
- set_cairo_blend_operator( dc, _blend_mode );
+ set_cairo_blend_operator( dc, _mix_blend_mode );
_cache->paintFromCache(dc, carea);
if (!carea) return RENDER_OK;
@@ -622,7 +622,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
nir |= (_filter != NULL && render_filters); // 3. it has a filter
nir |= needs_opacity; // 4. it is non-opaque
nir |= (_cache != NULL); // 5. it is cached
- nir |= (_blend_mode != SP_CSS_BLEND_NORMAL); // 6. Blend mode not normal
+ nir |= (_mix_blend_mode != SP_CSS_BLEND_NORMAL); // 6. Blend mode not normal
nir |= (_isolation == SP_CSS_ISOLATION_ISOLATE); // 7. Explicit isolatiom
/* How the rendering is done.
@@ -735,7 +735,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
}
dc.rectangle(*carea);
dc.setSource(&intermediate);
- set_cairo_blend_operator( dc, _blend_mode );
+ set_cairo_blend_operator( dc, _mix_blend_mode );
dc.fill();
dc.setSource(0,0,0,0);
// the call above is to clear a ref on the intermediate surface held by dc
diff --git a/src/display/drawing-item.h b/src/display/drawing-item.h
index d89299eeb..925bcbddb 100644
--- a/src/display/drawing-item.h
+++ b/src/display/drawing-item.h
@@ -209,7 +209,7 @@ protected:
unsigned _antialias : 1; ///< Whether to use antialiasing
unsigned _isolation : 1;
- unsigned _blend_mode : 4;
+ unsigned _mix_blend_mode : 4;
friend class Drawing;
};
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index a3f1a5d64..6c2ada9d7 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -602,7 +602,7 @@ void SPItem::update(SPCtx* /*ctx*/, guint flags) {
v->arenaitem->setOpacity(SP_SCALE24_TO_FLOAT(object->style->opacity.value));
v->arenaitem->setAntialiasing(object->style->shape_rendering.computed != SP_CSS_SHAPE_RENDERING_CRISPEDGES);
v->arenaitem->setIsolation( object->style->isolation.value );
- v->arenaitem->setBlendMode( object->style->blend_mode.value );
+ v->arenaitem->setBlendMode( object->style->mix_blend_mode.value );
v->arenaitem->setVisible(!item->isHidden());
}
}
@@ -1028,7 +1028,7 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned
ai->setTransform(transform);
ai->setOpacity(SP_SCALE24_TO_FLOAT(style->opacity.value));
ai->setIsolation( style->isolation.value );
- ai->setBlendMode( style->blend_mode.value );
+ ai->setBlendMode( style->mix_blend_mode.value );
//ai->setCompositeOperator( style->composite_op.value );
ai->setVisible(!isHidden());
ai->setSensitive(sensitive);
diff --git a/src/style.cpp b/src/style.cpp
index f0710e404..abc928d76 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -144,7 +144,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
opacity( "opacity", SP_SCALE24_MAX, false ),
isolation( "isolation", enum_isolation, SP_CSS_ISOLATION_AUTO ),
- blend_mode( "blend_mode", enum_blend_mode, SP_CSS_BLEND_NORMAL ),
+ mix_blend_mode( "mix-blend-mode", enum_blend_mode, SP_CSS_BLEND_NORMAL ),
paint_order(), // SPIPaintOrder
@@ -305,7 +305,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
_properties.push_back( &opacity );
_properties.push_back( &isolation );
- _properties.push_back( &blend_mode );
+ _properties.push_back( &mix_blend_mode );
_properties.push_back( &color_interpolation );
_properties.push_back( &color_interpolation_filters );
@@ -387,7 +387,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) :
// _propmap.insert( std::make_pair( opacity.name, reinterpret_cast<SPIBasePtr>(&SPStyle::opacity ) ) );
// _propmap.insert( std::make_pair( isolation.name, reinterpret_cast<SPIBasePtr>(&SPStyle::isolation ) ) );
- // _propmap.insert( std::make_pair( blend_mode.name, reinterpret_cast<SPIBasePtr>(&SPStyle::blend_mode ) ) );
+ // _propmap.insert( std::make_pair( mix_blend_mode.name, reinterpret_cast<SPIBasePtr>(&SPStyle::mix_blend_mode ) ) );
// _propmap.insert( std::make_pair( color_interpolation.name, reinterpret_cast<SPIBasePtr>(&SPStyle::color_interpolation ) ) );
// _propmap.insert( std::make_pair( color_interpolation_filters.name, reinterpret_cast<SPIBasePtr>(&SPStyle::color_interpolation_filters ) ) );
@@ -713,8 +713,8 @@ SPStyle::readIfUnset( gint id, gchar const *val ) {
case SP_PROP_ISOLATION:
isolation.readIfUnset( val );
break;
- case SP_PROP_BLEND_MODE:
- blend_mode.readIfUnset( val );
+ case SP_PROP_MIX_BLEND_MODE:
+ mix_blend_mode.readIfUnset( val );
break;
/* SVG */
diff --git a/src/style.h b/src/style.h
index eb8a3ed91..3627b4ec2 100644
--- a/src/style.h
+++ b/src/style.h
@@ -168,8 +168,7 @@ public:
/** mix-blend-mode: CSS Compositing and Blending Level 1 */
SPIEnum isolation;
- // Could be shared with Filter blending mode
- SPIEnum blend_mode;
+ SPIEnum mix_blend_mode;
SPIPaintOrder paint_order;