xref: /haiku/src/servers/app/drawing/Painter/drawing_modes/DrawingModeCopySolidSUBPIX.h (revision 59e13a3f06eedbc797f797da71c6810634b22cd4)
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_COPY ignoring the pattern (solid) on B_RGBA32.
7  *
8  */
9 
10 #ifndef DRAWING_MODE_COPY_SOLID_SUBPIX_H
11 #define DRAWING_MODE_COPY_SOLID_SUBPIX_H
12 
13 #include "DrawingModeOverSUBPIX.h"
14 #include "GlobalSubpixelSettings.h"
15 
16 
17 // blend_solid_hspan_copy_solid_subpix
18 void
blend_solid_hspan_copy_solid_subpix(int x,int y,unsigned len,const color_type & c,const uint8 * covers,agg_buffer * buffer,const PatternHandler * pattern)19 blend_solid_hspan_copy_solid_subpix(int x, int y, unsigned len,
20 	const color_type& c, const uint8* covers, agg_buffer* buffer,
21 	const PatternHandler* pattern)
22 {
23 	uint8* p = buffer->row_ptr(y) + (x << 2);
24 	const int subpixelL = gSubpixelOrderingRGB ? 2 : 0;
25 	const int subpixelM = 1;
26 	const int subpixelR = gSubpixelOrderingRGB ? 0 : 2;
27 	do {
28 		BLEND_OVER_SUBPIX(p, c.r, c.g, c.b, covers[subpixelL],
29 			covers[subpixelM], covers[subpixelR]);
30 		covers += 3;
31 		p += 4;
32 		x++;
33 		len -= 3;
34 	} while (len);
35 }
36 
37 #endif // DRAWING_MODE_COPY_SOLID_SUBPIX_H
38 
39