Use correct color when OPERATOR_SOURCE is used on a surface without alpha information.

This commit is contained in:
Christian Biesinger 2005-12-19 17:16:28 +00:00
parent d0eaab305c
commit 606d23b287
2 changed files with 16 additions and 0 deletions

View file

@ -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),

View file

@ -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);