xref: /haiku/src/servers/app/drawing/Painter/drawing_modes/DrawingModeOverSolidSUBPIX.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2005, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2008, Andrej Spielmann <andrej.spielmann@seh.ox.ac.uk>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  *
6  * DrawingMode implementing B_OP_OVER on B_RGBA32.
7  *
8  */
9 
10 #ifndef DRAWING_MODE_OVER_SOLID_SUBPIX_H
11 #define DRAWING_MODE_OVER_SOLID_SUBPIX_H
12 
13 #include "DrawingModeOverSUBPIX.h"
14 #include "GlobalSubpixelSettings.h"
15 
16 // blend_solid_hspan_over_solid_subpix
17 void
18 blend_solid_hspan_over_solid_subpix(int x, int y, unsigned len,
19 	const color_type& c, const uint8* covers, agg_buffer* buffer,
20 	const PatternHandler* pattern)
21 {
22 	if (pattern->IsSolidLow())
23 		return;
24 
25 	uint8* p = buffer->row_ptr(y) + (x << 2);
26 	const int subpixelL = gSubpixelOrderingRGB ? 2 : 0;
27 	const int subpixelM = 1;
28 	const int subpixelR = gSubpixelOrderingRGB ? 0 : 2;
29 	do {
30 		BLEND_OVER_SUBPIX(p, c.r, c.g, c.b,
31 			covers[subpixelL], covers[subpixelM], covers[subpixelR]);
32 		covers += 3;
33 		p += 4;
34 		x++;
35 		len -= 3;
36 	} while (len);
37 }
38 
39 #endif // DRAWING_MODE_OVER_SUBPIX_H
40 
41