summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@web.de>2005-12-19 17:16:28 +0000
committerChristian Biesinger <cbiesinger@web.de>2005-12-19 17:16:28 +0000
commit606d23b2874288c18f7373ffa47b0fb6b63b3451 (patch)
tree66eef6039a9851830f43f9711fabfa0189c7b06a
parentd0eaab305c69b386fde72fb0a325df2c5d62385d (diff)
Use correct color when OPERATOR_SOURCE is used on a surface without alpha information.
-rw-r--r--ChangeLog5
-rw-r--r--src/cairo-beos-surface.cpp11
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d31375ad..0e509e72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-20 Christian Biesinger <cbiesinger@web.de>
+
+ * src/cairo-beos-surface.cpp: Use correct color when OPERATOR_SOURCE
+ is used on a surface without alpha information.
+
2005-12-19 Keith Packard <keithp@keithp.com>
* src/cairo-clip.c: (_cairo_clip_intersect_to_rectangle),
diff --git a/src/cairo-beos-surface.cpp b/src/cairo-beos-surface.cpp
index d9c3a953..03abd11b 100644
--- a/src/cairo-beos-surface.cpp
+++ b/src/cairo-beos-surface.cpp
@@ -567,6 +567,17 @@ _cairo_beos_fill_rectangles (void *abstract_surface,
if (mode == B_OP_ALPHA && be_color.alpha == 0xFF)
mode = B_OP_COPY;
+ // For CAIRO_OPERATOR_SOURCE, cairo expects us to use the premultiplied
+ // color info. This is only relevant when drawing into an rgb24 buffer
+ // (as for others, we can convert when asked for the image)
+ if (mode == B_OP_COPY &&
+ (!surface->bitmap || surface->bitmap->ColorSpace() != B_RGBA32))
+ {
+ be_color.red = premultiply(be_color.red, be_color.alpha);
+ be_color.green = premultiply(be_color.green, be_color.alpha);
+ be_color.blue = premultiply(be_color.blue, be_color.alpha);
+ }
+
surface->view->PushState();
surface->view->SetDrawingMode(mode);