summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-02-29 07:45:33 +0000
committerJon A. Cruz <jon@joncruz.org>2012-02-29 07:45:33 +0000
commit195b9e70dd686d20db28c45c0958280e85ecede3 (patch)
tree223aca97567af7e6b8439440705b35f2878505b8 /src/display
parentHeader tidying, suppress all gdk deprecation errors in gtkmm (diff)
downloadinkscape-195b9e70dd686d20db28c45c0958280e85ecede3.tar.gz
inkscape-195b9e70dd686d20db28c45c0958280e85ecede3.zip
Cleanup of unused variables and warnings.
(bzr r11031)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/cairo-utils.h32
-rw-r--r--src/display/drawing-item.cpp3
2 files changed, 33 insertions, 2 deletions
diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h
index dbe874365..e67872891 100644
--- a/src/display/cairo-utils.h
+++ b/src/display/cairo-utils.h
@@ -144,7 +144,37 @@ void feed_pathvector_to_cairo (cairo_t *ct, Geom::PathVector const &pathv);
#define ASSEMBLE_ARGB32(px,a,r,g,b) \
guint32 px = (a << 24) | (r << 16) | (g << 8) | b;
-#endif
+namespace Inkscape {
+
+namespace Display
+{
+
+inline void ExtractARGB32(guint32 px, guint32 &a, guint32 &r, guint32 &g, guint &b)
+{
+ a = ((px) & 0xff000000) >> 24;
+ r = ((px) & 0x00ff0000) >> 16;
+ g = ((px) & 0x0000ff00) >> 8;
+ b = ((px) & 0x000000ff);
+}
+
+inline void ExtractRGB32(guint32 px, guint32 &r, guint32 &g, guint &b)
+{
+ r = ((px) & 0x00ff0000) >> 16;
+ g = ((px) & 0x0000ff00) >> 8;
+ b = ((px) & 0x000000ff);
+}
+
+inline guint AssembleARGB32(guint32 a, guint32 r, guint32 g, guint32 b)
+{
+ return (a << 24) | (r << 16) | (g << 8) | b;
+}
+
+} // namespace Display
+
+} // namespace Inkscape
+
+#endif // SEEN_INKSCAPE_DISPLAY_CAIRO_UTILS_H
+
/*
Local Variables:
mode:c++
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index df44a3de0..0fb1f0018 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -431,7 +431,8 @@ DrawingItem::update(Geom::IntRect const &area, UpdateContext const &ctx, unsigne
struct MaskLuminanceToAlpha {
guint32 operator()(guint32 in) {
- EXTRACT_ARGB32(in, a, r, g, b)
+ guint r = 0, g = 0, b = 0;
+ Display::ExtractRGB32(in, r, g, b);
// the operation of unpremul -> luminance-to-alpha -> multiply by alpha
// is equivalent to luminance-to-alpha on premultiplied color values
// original computation in double: r*0.2125 + g*0.7154 + b*0.0721