summaryrefslogtreecommitdiffstats
path: root/external/cairo/cairo/cairo.GL_RGBA.patch
blob: bad6a81ed54124a982f9a9d3e33634b633f49afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
--- misc/cairo-1.10.2/src/cairo-image-surface.c
+++ misc/cairo-1.10.2/src/cairo-image-surface.c
@@ -97,11 +97,11 @@
 	return CAIRO_FORMAT_RGBA128F;
     case PIXMAN_rgb_float:
 	return CAIRO_FORMAT_RGB96F;
-    case PIXMAN_a8r8g8b8:
+    case PIXMAN_a8b8g8r8: //tweaked
 	return CAIRO_FORMAT_ARGB32;
     case PIXMAN_x2r10g10b10:
 	return CAIRO_FORMAT_RGB30;
-    case PIXMAN_x8r8g8b8:
+    case PIXMAN_x8b8g8r8: //tweaked
 	return CAIRO_FORMAT_RGB24;
     case PIXMAN_a8:
 	return CAIRO_FORMAT_A8;
@@ -109,7 +109,7 @@
 	return CAIRO_FORMAT_A1;
     case PIXMAN_r5g6b5:
 	return CAIRO_FORMAT_RGB16_565;
-	case PIXMAN_r8g8b8:
+	case PIXMAN_b8g8r8: //tweaked
 	return CAIRO_FORMAT_RGB24_888;
 #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0)
     case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8:
@@ -117,8 +117,8 @@
 #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2)
     case PIXMAN_a8r8g8b8_sRGB:
 #endif
-	case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8:
-    case PIXMAN_b8g8r8:   case PIXMAN_b5g6r5:
+    case PIXMAN_a8r8g8b8: case PIXMAN_x8r8g8b8: //tweaked
+    case PIXMAN_r8g8b8:   case PIXMAN_b5g6r5:
     case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:
     case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4:
     case PIXMAN_a4b4g4r4: case PIXMAN_x4b4g4r4: case PIXMAN_r3g3b2:
@@ -320,7 +320,7 @@
 	ret = PIXMAN_a8;
 	break;
     case CAIRO_FORMAT_RGB24:
-	ret = PIXMAN_x8r8g8b8;
+	ret = PIXMAN_x8b8g8r8; //tweaked
 	break;
     case CAIRO_FORMAT_RGB30:
 	ret = PIXMAN_x2r10g10b10;
@@ -335,12 +335,12 @@
 	ret = PIXMAN_rgba_float;
 	break;
 	case CAIRO_FORMAT_RGB24_888:
-	ret = PIXMAN_r8g8b8;
+	ret = PIXMAN_b8g8r8; // tweaked
 	break;
     case CAIRO_FORMAT_ARGB32:
     case CAIRO_FORMAT_INVALID:
     default:
-	ret = PIXMAN_a8r8g8b8;
+	ret = PIXMAN_a8b8g8r8; //tweaked
 	break;
     }
     return ret;
--- misc/cairo-1.10.2/src/cairo-ft-font.c
+++ misc/cairo-1.10.2/src/cairo-ft-font.c
@@ -1318,6 +1321,19 @@
 	    memcpy (data, bitmap->buffer, (size_t)stride * height);
 	}
 
+	{
+	    /* swizzle to rgba */
+	    unsigned int i, count = height * width;
+	    unsigned char *p = data;
+	    for (i = 0; i < count; i++)
+	    {
+		unsigned char tmp = p[0];
+		p[0] = p[2];
+		p[2] = tmp;
+		p+=4;
+	    }
+	}
+
 	if (!_cairo_is_little_endian ())
 	{
 	    /* Byteswap. */
@@ -2573,7 +2589,7 @@
     if (unlikely (status))
 	return status;
 
-    if (pixman_image_get_format (surface->pixman_image) == PIXMAN_a8r8g8b8 &&
+    if (pixman_image_get_format (surface->pixman_image) == PIXMAN_a8b8g8r8 &&
 	!pixman_image_get_component_alpha (surface->pixman_image)) {
 	_cairo_scaled_glyph_set_color_surface (scaled_glyph,
 					       &scaled_font->base,
--- misc/cairo-1.10.2/src/cairo-image-compositor.c
+++ misc/cairo-1.10.2/src/cairo-image-compositor.c
@@ -1074,7 +1074,7 @@
     format = PIXMAN_a8;
     i = (info->extents.width + 3) & ~3;
     if (scaled_glyph->surface->base.content & CAIRO_CONTENT_COLOR) {
-	format = PIXMAN_a8r8g8b8;
+	format = PIXMAN_a8b8g8r8;
 	i = info->extents.width * 4;
     }
 
@@ -1126,7 +1126,7 @@
 		format == PIXMAN_a8) {
 		pixman_image_t *ca_mask;
 
-		format = PIXMAN_a8r8g8b8;
+		format = PIXMAN_a8b8g8r8;
 		ca_mask = pixman_image_create_bits (format,
 						    info->extents.width,
 						    info->extents.height,
@@ -1175,7 +1175,7 @@
 	}
     }
 
-    if (format == PIXMAN_a8r8g8b8)
+    if (format == PIXMAN_a8b8g8r8)
 	pixman_image_set_component_alpha (mask, TRUE);
 
     pixman_image_composite32 (_pixman_operator (op),