Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: xfa/fxgraphics/cfx_graphics.cpp

Issue 1810563002: Move xfa/include/fxgraphics/fx_graphics.h to xfa/fxgraphics. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxgraphics/cfx_color.cpp ('k') | xfa/fxgraphics/cfx_path.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/include/fxgraphics/fx_graphics.h" 7 #include "xfa/fxgraphics/include/cfx_graphics.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "xfa/fxgraphics/fx_path_generator.h" 11 #include "xfa/fxgraphics/cagg_graphics.h"
12 #include "xfa/fxgraphics/pre.h" 12 #include "xfa/fxgraphics/cfx_color.h"
13 #include "xfa/fxgraphics/cfx_path.h"
14 #include "xfa/fxgraphics/cfx_path_generator.h"
15 #include "xfa/fxgraphics/cfx_pattern.h"
16 #include "xfa/fxgraphics/cfx_shading.h"
17
18 namespace {
19
20 enum {
21 FX_CONTEXT_None = 0,
22 FX_CONTEXT_Device,
23 };
24
25 #define FX_HATCHSTYLE_Total 53
26
27 struct FX_HATCHDATA {
28 int32_t width;
29 int32_t height;
30 uint8_t maskBits[64];
31 };
32
33 const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = {
34 {16,
35 16,
36 {
37 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
39 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
41 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
42 0x00, 0x00, 0x00, 0x00,
43 }},
44 {16,
45 16,
46 {
47 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
48 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
49 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
50 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
51 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
52 0x80, 0x80, 0x00, 0x00,
53 }},
54 {16,
55 16,
56 {
57 0x80, 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00,
58 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,
59 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
60 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
61 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00,
62 0x01, 0x01, 0x00, 0x00,
63 }},
64 {16,
65 16,
66 {
67 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,
68 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00,
69 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
70 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
71 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00,
72 0x80, 0x80, 0x00, 0x00,
73 }},
74 {16,
75 16,
76 {
77 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
78 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
79 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
80 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
81 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
82 0x80, 0x80, 0x00, 0x00,
83 }},
84 {16,
85 16,
86 {
87 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00,
88 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00,
89 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00,
90 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
91 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00,
92 0x81, 0x81, 0x00, 0x00,
93 }},
94 {16,
95 16,
96 {
97 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00,
103 }},
104 {16,
105 16,
106 {
107 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00,
113 }},
114 {16,
115 16,
116 {
117 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
118 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
119 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
120 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
122 0x00, 0x00, 0x00, 0x00,
123 }},
124 {16,
125 16,
126 {
127 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
128 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
129 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
130 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
131 0x88, 0x88, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
132 0x22, 0x22, 0x00, 0x00,
133 }},
134 {16,
135 16,
136 {
137 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
138 0x11, 0x11, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
139 0xaa, 0xaa, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
140 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
141 0xaa, 0xaa, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
142 0x11, 0x11, 0x00, 0x00,
143 }},
144 {16,
145 16,
146 {
147 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
148 0x51, 0x51, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
149 0xaa, 0xaa, 0x00, 0x00, 0x15, 0x15, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
150 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x51, 0x51, 0x00, 0x00,
151 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
152 0x15, 0x15, 0x00, 0x00,
153 }},
154 {16,
155 16,
156 {
157 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
158 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
159 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
160 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
161 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
162 0x55, 0x55, 0x00, 0x00,
163 }},
164 {16,
165 16,
166 {
167 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00,
168 0x55, 0x55, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
169 0xbb, 0xbb, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00,
170 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
171 0xee, 0xee, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xbb, 0xbb, 0x00, 0x00,
172 0x55, 0x55, 0x00, 0x00,
173 }},
174 {16,
175 16,
176 {
177 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
178 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00,
179 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
180 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00,
181 0x77, 0x77, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
182 0xdd, 0xdd, 0x00, 0x00,
183 }},
184 {16,
185 16,
186 {
187 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00,
188 0xff, 0xff, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
189 0xdd, 0xdd, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
190 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
191 0x77, 0x77, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xdd, 0xdd, 0x00, 0x00,
192 0xff, 0xff, 0x00, 0x00,
193 }},
194 {16,
195 16,
196 {
197 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00,
198 0xff, 0xff, 0x00, 0x00, 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
199 0xfe, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xef, 0xef, 0x00, 0x00,
200 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
201 0xef, 0xef, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00,
202 0xff, 0xff, 0x00, 0x00,
203 }},
204 {16,
205 16,
206 {
207 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
208 0xf7, 0xf7, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
209 0xff, 0xff, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
210 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xf7, 0xf7, 0x00, 0x00,
211 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
212 0x7f, 0x7f, 0x00, 0x00,
213 }},
214 {16,
215 16,
216 {
217 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
218 0x11, 0x11, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
219 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
220 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
221 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
222 0x11, 0x11, 0x00, 0x00,
223 }},
224 {16,
225 16,
226 {
227 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
228 0x88, 0x88, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
229 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
230 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
231 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
232 0x88, 0x88, 0x00, 0x00,
233 }},
234 {16,
235 16,
236 {
237 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00,
238 0x99, 0x99, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
239 0x33, 0x33, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
240 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00,
241 0xcc, 0xcc, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00,
242 0x99, 0x99, 0x00, 0x00,
243 }},
244 {16,
245 16,
246 {
247 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
248 0x99, 0x99, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
249 0xcc, 0xcc, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00,
250 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00,
251 0x33, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
252 0x99, 0x99, 0x00, 0x00,
253 }},
254 {16,
255 16,
256 {
257 0xc1, 0xc1, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00,
258 0x38, 0x38, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00,
259 0x07, 0x07, 0x00, 0x00, 0x83, 0x83, 0x00, 0x00, 0xc1, 0xc1, 0x00, 0x00,
260 0xe0, 0xe0, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00,
261 0x1c, 0x1c, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
262 0x83, 0x83, 0x00, 0x00,
263 }},
264 {16,
265 16,
266 {
267 0x83, 0x83, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00,
268 0x1c, 0x1c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00,
269 0xe0, 0xe0, 0x00, 0x00, 0xc1, 0xc1, 0x00, 0x00, 0x83, 0x83, 0x00, 0x00,
270 0x07, 0x07, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00,
271 0x38, 0x38, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00,
272 0xc1, 0xc1, 0x00, 0x00,
273 }},
274 {16,
275 16,
276 {
277 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
278 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
279 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
280 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
281 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
282 0x88, 0x88, 0x00, 0x00,
283 }},
284 {16,
285 16,
286 {
287 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
289 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
290 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
291 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
292 0x00, 0x00, 0x00, 0x00,
293 }},
294 {16,
295 16,
296 {
297 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
298 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
299 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
300 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
301 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
302 0x55, 0x55, 0x00, 0x00,
303 }},
304 {16,
305 16,
306 {
307 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
308 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
309 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
310 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
311 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
312 0x00, 0x00, 0x00, 0x00,
313 }},
314 {16,
315 16,
316 {
317 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
318 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
319 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
320 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
321 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00,
322 0xcc, 0xcc, 0x00, 0x00,
323 }},
324 {16,
325 16,
326 {
327 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
328 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
329 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
330 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
331 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
332 0x00, 0x00, 0x00, 0x00,
333 }},
334 {16,
335 16,
336 {
337 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
338 0x44, 0x44, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
340 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
341 0x22, 0x22, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342 0x00, 0x00, 0x00, 0x00,
343 }},
344 {16,
345 16,
346 {
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00,
348 0x22, 0x22, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
350 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
351 0x44, 0x44, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
352 0x00, 0x00, 0x00, 0x00,
353 }},
354 {16,
355 16,
356 {
357 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
358 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
359 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
360 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
361 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
362 0x00, 0x00, 0x00, 0x00,
363 }},
364 {16,
365 16,
366 {
367 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
368 0x80, 0x80, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
369 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
370 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
371 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
372 0x08, 0x08, 0x00, 0x00,
373 }},
374 {16,
375 16,
376 {
377 0x80, 0x80, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00,
378 0x02, 0x02, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
379 0x20, 0x20, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
380 0x08, 0x08, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00,
381 0x10, 0x10, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00,
382 0x04, 0x04, 0x00, 0x00,
383 }},
384 {16,
385 16,
386 {
387 0xb1, 0xb1, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00,
388 0x1b, 0x1b, 0x00, 0x00, 0xd8, 0xd8, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00,
389 0x0c, 0x0c, 0x00, 0x00, 0x8d, 0x8d, 0x00, 0x00, 0xb1, 0xb1, 0x00, 0x00,
390 0x30, 0x30, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x1b, 0x1b, 0x00, 0x00,
391 0xd8, 0xd8, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00,
392 0x8d, 0x8d, 0x00, 0x00,
393 }},
394 {16,
395 16,
396 {
397 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00,
398 0x18, 0x18, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00,
399 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00,
400 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
401 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00,
402 0x18, 0x18, 0x00, 0x00,
403 }},
404 {16,
405 16,
406 {
407 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00,
408 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
409 0x25, 0x25, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
410 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00,
411 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x25, 0x25, 0x00, 0x00,
412 0xc0, 0xc0, 0x00, 0x00,
413 }},
414 {16,
415 16,
416 {
417 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,
418 0x08, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00,
419 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
420 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
421 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00,
422 0x81, 0x81, 0x00, 0x00,
423 }},
424 {16,
425 16,
426 {
427 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
428 0x80, 0x80, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
429 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
430 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
431 0xff, 0xff, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
432 0x08, 0x08, 0x00, 0x00,
433 }},
434 {16,
435 16,
436 {
437 0x88, 0x88, 0x00, 0x00, 0x54, 0x54, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
438 0x45, 0x45, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00,
439 0x22, 0x22, 0x00, 0x00, 0x51, 0x51, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
440 0x54, 0x54, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x45, 0x45, 0x00, 0x00,
441 0x88, 0x88, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
442 0x51, 0x51, 0x00, 0x00,
443 }},
444 {16,
445 16,
446 {
447 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
448 0x55, 0x55, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
449 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
450 0x55, 0x55, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
451 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
452 0xf0, 0xf0, 0x00, 0x00,
453 }},
454 {16,
455 16,
456 {
457 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
458 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
459 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
460 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
461 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
462 0x80, 0x80, 0x00, 0x00,
463 }},
464 {16,
465 16,
466 {
467 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
468 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
469 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00,
470 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
471 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
472 0x00, 0x00, 0x00, 0x00,
473 }},
474 {16,
475 16,
476 {
477 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
478 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
479 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
480 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
481 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
482 0x00, 0x00, 0x00, 0x00,
483 }},
484 {16,
485 16,
486 {
487 0x03, 0x03, 0x00, 0x00, 0x84, 0x84, 0x00, 0x00, 0x48, 0x48, 0x00, 0x00,
488 0x30, 0x30, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00,
489 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00,
490 0x84, 0x84, 0x00, 0x00, 0x48, 0x48, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00,
491 0x0c, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
492 0x01, 0x01, 0x00, 0x00,
493 }},
494 {16,
495 16,
496 {
497 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
498 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
499 0xff, 0xff, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
500 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00,
501 0xff, 0xff, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
502 0x99, 0x99, 0x00, 0x00,
503 }},
504 {16,
505 16,
506 {
507 0x77, 0x77, 0x00, 0x00, 0x89, 0x89, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00,
508 0x8f, 0x8f, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00, 0x98, 0x98, 0x00, 0x00,
509 0xf8, 0xf8, 0x00, 0x00, 0xf8, 0xf8, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
510 0x89, 0x89, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00, 0x8f, 0x8f, 0x00, 0x00,
511 0x77, 0x77, 0x00, 0x00, 0x98, 0x98, 0x00, 0x00, 0xf8, 0xf8, 0x00, 0x00,
512 0xf8, 0xf8, 0x00, 0x00,
513 }},
514 {16,
515 16,
516 {
517 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
518 0x88, 0x88, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
519 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
520 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
521 0xff, 0xff, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00,
522 0x88, 0x88, 0x00, 0x00,
523 }},
524 {16,
525 16,
526 {
527 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
528 0x99, 0x99, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
529 0x66, 0x66, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00,
530 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00,
531 0x99, 0x99, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00,
532 0x99, 0x99, 0x00, 0x00,
533 }},
534 {16,
535 16,
536 {
537 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
538 0xf0, 0xf0, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00,
539 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
540 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00,
541 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00,
542 0x0f, 0x0f, 0x00, 0x00,
543 }},
544 {16,
545 16,
546 {
547 0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00,
548 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
549 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00,
550 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
551 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00,
552 0x01, 0x01, 0x00, 0x00,
553 }},
554 {16,
555 16,
556 {
557 0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00,
558 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00,
559 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
560 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00,
561 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
562 0x00, 0x00, 0x00, 0x00,
563 }},
564 };
565
566 } // namespace
13 567
14 CFX_Graphics::CFX_Graphics() 568 CFX_Graphics::CFX_Graphics()
15 : m_renderDevice(nullptr), m_aggGraphics(nullptr) {} 569 : m_renderDevice(nullptr), m_aggGraphics(nullptr) {}
16 570
17 FX_ERR CFX_Graphics::Create(CFX_RenderDevice* renderDevice, 571 FX_ERR CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
18 FX_BOOL isAntialiasing) { 572 FX_BOOL isAntialiasing) {
19 if (!renderDevice) 573 if (!renderDevice)
20 return FX_ERR_Parameter_Invalid; 574 return FX_ERR_Parameter_Invalid;
21 if (m_type != FX_CONTEXT_None) 575 if (m_type != FX_CONTEXT_None)
22 return FX_ERR_Property_Invalid; 576 return FX_ERR_Property_Invalid;
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path* path, 1314 FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path* path,
761 FX_FillMode fillMode, 1315 FX_FillMode fillMode,
762 CFX_Matrix* matrix) { 1316 CFX_Matrix* matrix) {
763 CFX_Pattern* pattern = m_info.fillColor->m_info.pattern; 1317 CFX_Pattern* pattern = m_info.fillColor->m_info.pattern;
764 CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap(); 1318 CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap();
765 int32_t width = bitmap->GetWidth(); 1319 int32_t width = bitmap->GetWidth();
766 int32_t height = bitmap->GetHeight(); 1320 int32_t height = bitmap->GetHeight();
767 CFX_DIBitmap bmp; 1321 CFX_DIBitmap bmp;
768 bmp.Create(width, height, FXDIB_Argb); 1322 bmp.Create(width, height, FXDIB_Argb);
769 m_renderDevice->GetDIBits(&bmp, 0, 0); 1323 m_renderDevice->GetDIBits(&bmp, 0, 0);
770 switch (pattern->m_type) { 1324
771 case FX_PATTERN_Bitmap: { 1325 FX_HatchStyle hatchStyle = m_info.fillColor->m_info.pattern->m_hatchStyle;
772 int32_t xStep = FXSYS_round(pattern->m_bitmapInfo.x1Step); 1326 if (hatchStyle < FX_HATCHSTYLE_Horizontal ||
773 int32_t yStep = FXSYS_round(pattern->m_bitmapInfo.y1Step); 1327 hatchStyle > FX_HATCHSTYLE_SolidDiamond) {
774 int32_t xCount = width / xStep + 1; 1328 return FX_ERR_Intermediate_Value_Invalid;
775 int32_t yCount = height / yStep + 1; 1329 }
776 for (int32_t i = 0; i <= yCount; i++) { 1330 const FX_HATCHDATA& data = hatchBitmapData[hatchStyle];
777 for (int32_t j = 0; j <= xCount; j++) { 1331 CFX_DIBitmap mask;
778 bmp.TransferBitmap(j * xStep, i * yStep, xStep, yStep, 1332 mask.Create(data.width, data.height, FXDIB_1bppMask);
779 pattern->m_bitmapInfo.bitmap, 0, 0); 1333 FXSYS_memcpy(mask.GetBuffer(), data.maskBits, mask.GetPitch() * data.height);
780 } 1334 CFX_FloatRect rectf = path->GetPathData()->GetBoundingBox();
781 } 1335 if (matrix) {
782 break; 1336 rectf.Transform((const CFX_Matrix*)matrix);
783 } 1337 }
784 case FX_PATTERN_Hatch: { 1338 FX_RECT rect(FXSYS_round(rectf.left), FXSYS_round(rectf.top),
785 FX_HatchStyle hatchStyle = 1339 FXSYS_round(rectf.right), FXSYS_round(rectf.bottom));
786 m_info.fillColor->m_info.pattern->m_hatchInfo.hatchStyle; 1340 CFX_FxgeDevice device;
787 if (hatchStyle < FX_HATCHSTYLE_Horizontal || 1341 device.Attach(&bmp);
788 hatchStyle > FX_HATCHSTYLE_SolidDiamond) { 1342 device.FillRect(&rect, m_info.fillColor->m_info.pattern->m_backArgb);
789 return FX_ERR_Intermediate_Value_Invalid; 1343 for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
790 } 1344 for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) {
791 const FX_HATCHDATA& data = hatchBitmapData[hatchStyle]; 1345 device.SetBitMask(&mask, i, j,
792 CFX_DIBitmap mask; 1346 m_info.fillColor->m_info.pattern->m_foreArgb);
793 mask.Create(data.width, data.height, FXDIB_1bppMask);
794 FXSYS_memcpy(mask.GetBuffer(), data.maskBits,
795 mask.GetPitch() * data.height);
796 CFX_FloatRect rectf = path->GetPathData()->GetBoundingBox();
797 if (matrix) {
798 rectf.Transform((const CFX_Matrix*)matrix);
799 }
800 FX_RECT rect(FXSYS_round(rectf.left), FXSYS_round(rectf.top),
801 FXSYS_round(rectf.right), FXSYS_round(rectf.bottom));
802 CFX_FxgeDevice device;
803 device.Attach(&bmp);
804 device.FillRect(&rect,
805 m_info.fillColor->m_info.pattern->m_hatchInfo.backArgb);
806 for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
807 for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) {
808 device.SetBitMask(
809 &mask, i, j,
810 m_info.fillColor->m_info.pattern->m_hatchInfo.foreArgb);
811 }
812 }
813 break;
814 } 1347 }
815 } 1348 }
1349
816 m_renderDevice->SaveState(); 1350 m_renderDevice->SaveState();
817 m_renderDevice->SetClip_PathFill(path->GetPathData(), (CFX_Matrix*)matrix, 1351 m_renderDevice->SetClip_PathFill(path->GetPathData(), (CFX_Matrix*)matrix,
818 fillMode); 1352 fillMode);
819 SetDIBitsWithMatrix(&bmp, &pattern->m_matrix); 1353 SetDIBitsWithMatrix(&bmp, &pattern->m_matrix);
820 m_renderDevice->RestoreState(); 1354 m_renderDevice->RestoreState();
821 return FX_ERR_Succeeded; 1355 return FX_ERR_Succeeded;
822 } 1356 }
823 1357
824 FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path, 1358 FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
825 FX_FillMode fillMode, 1359 FX_FillMode fillMode,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 CTM = other.CTM; 1557 CTM = other.CTM;
1024 isActOnDash = other.isActOnDash; 1558 isActOnDash = other.isActOnDash;
1025 strokeColor = other.strokeColor; 1559 strokeColor = other.strokeColor;
1026 fillColor = other.fillColor; 1560 fillColor = other.fillColor;
1027 font = other.font; 1561 font = other.font;
1028 fontSize = other.fontSize; 1562 fontSize = other.fontSize;
1029 fontHScale = other.fontHScale; 1563 fontHScale = other.fontHScale;
1030 fontSpacing = other.fontSpacing; 1564 fontSpacing = other.fontSpacing;
1031 return *this; 1565 return *this;
1032 } 1566 }
1033
1034 CAGG_Graphics::CAGG_Graphics() {
1035 m_owner = nullptr;
1036 }
1037
1038 FX_ERR CAGG_Graphics::Create(CFX_Graphics* owner,
1039 int32_t width,
1040 int32_t height,
1041 FXDIB_Format format) {
1042 if (owner->m_renderDevice)
1043 return FX_ERR_Parameter_Invalid;
1044 if (m_owner)
1045 return FX_ERR_Property_Invalid;
1046
1047 CFX_FxgeDevice* device = new CFX_FxgeDevice;
1048 device->Create(width, height, format);
1049 m_owner = owner;
1050 m_owner->m_renderDevice = device;
1051 m_owner->m_renderDevice->GetBitmap()->Clear(0xFFFFFFFF);
1052 return FX_ERR_Succeeded;
1053 }
1054
1055 CAGG_Graphics::~CAGG_Graphics() {
1056 if (m_owner->m_renderDevice)
1057 delete (CFX_FxgeDevice*)m_owner->m_renderDevice;
1058 m_owner = nullptr;
1059 }
1060
1061 CFX_Path::CFX_Path() {
1062 m_generator = nullptr;
1063 }
1064
1065 FX_ERR CFX_Path::Create() {
1066 if (m_generator)
1067 return FX_ERR_Property_Invalid;
1068
1069 m_generator = new CFX_PathGenerator;
1070 m_generator->Create();
1071 return FX_ERR_Succeeded;
1072 }
1073
1074 CFX_Path::~CFX_Path() {
1075 delete m_generator;
1076 }
1077
1078 FX_ERR CFX_Path::MoveTo(FX_FLOAT x, FX_FLOAT y) {
1079 if (!m_generator)
1080 return FX_ERR_Property_Invalid;
1081 m_generator->MoveTo(x, y);
1082 return FX_ERR_Succeeded;
1083 }
1084
1085 FX_ERR CFX_Path::LineTo(FX_FLOAT x, FX_FLOAT y) {
1086 if (!m_generator)
1087 return FX_ERR_Property_Invalid;
1088 m_generator->LineTo(x, y);
1089 return FX_ERR_Succeeded;
1090 }
1091
1092 FX_ERR CFX_Path::BezierTo(FX_FLOAT ctrlX1,
1093 FX_FLOAT ctrlY1,
1094 FX_FLOAT ctrlX2,
1095 FX_FLOAT ctrlY2,
1096 FX_FLOAT toX,
1097 FX_FLOAT toY) {
1098 if (!m_generator)
1099 return FX_ERR_Property_Invalid;
1100 m_generator->BezierTo(ctrlX1, ctrlY1, ctrlX2, ctrlY2, toX, toY);
1101 return FX_ERR_Succeeded;
1102 }
1103
1104 FX_ERR CFX_Path::ArcTo(FX_FLOAT left,
1105 FX_FLOAT top,
1106 FX_FLOAT width,
1107 FX_FLOAT height,
1108 FX_FLOAT startAngle,
1109 FX_FLOAT sweepAngle) {
1110 if (!m_generator)
1111 return FX_ERR_Property_Invalid;
1112 m_generator->ArcTo(left + width / 2, top + height / 2, width / 2, height / 2,
1113 startAngle, sweepAngle);
1114 return FX_ERR_Succeeded;
1115 }
1116
1117 FX_ERR CFX_Path::Close() {
1118 if (!m_generator)
1119 return FX_ERR_Property_Invalid;
1120 m_generator->Close();
1121 return FX_ERR_Succeeded;
1122 }
1123
1124 FX_ERR CFX_Path::AddLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2) {
1125 if (!m_generator)
1126 return FX_ERR_Property_Invalid;
1127 m_generator->AddLine(x1, y1, x2, y2);
1128 return FX_ERR_Succeeded;
1129 }
1130
1131 FX_ERR CFX_Path::AddBezier(FX_FLOAT startX,
1132 FX_FLOAT startY,
1133 FX_FLOAT ctrlX1,
1134 FX_FLOAT ctrlY1,
1135 FX_FLOAT ctrlX2,
1136 FX_FLOAT ctrlY2,
1137 FX_FLOAT endX,
1138 FX_FLOAT endY) {
1139 if (!m_generator)
1140 return FX_ERR_Property_Invalid;
1141 m_generator->AddBezier(startX, startY, ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX,
1142 endY);
1143 return FX_ERR_Succeeded;
1144 }
1145
1146 FX_ERR CFX_Path::AddRectangle(FX_FLOAT left,
1147 FX_FLOAT top,
1148 FX_FLOAT width,
1149 FX_FLOAT height) {
1150 if (!m_generator)
1151 return FX_ERR_Property_Invalid;
1152 m_generator->AddRectangle(left, top, left + width, top + height);
1153 return FX_ERR_Succeeded;
1154 }
1155
1156 FX_ERR CFX_Path::AddEllipse(FX_FLOAT left,
1157 FX_FLOAT top,
1158 FX_FLOAT width,
1159 FX_FLOAT height) {
1160 if (!m_generator)
1161 return FX_ERR_Property_Invalid;
1162 m_generator->AddEllipse(left + width / 2, top + height / 2, width / 2,
1163 height / 2);
1164 return FX_ERR_Succeeded;
1165 }
1166
1167 FX_ERR CFX_Path::AddEllipse(const CFX_RectF& rect) {
1168 if (!m_generator)
1169 return FX_ERR_Property_Invalid;
1170 m_generator->AddEllipse(rect.left + rect.Width() / 2,
1171 rect.top + rect.Height() / 2, rect.Width() / 2,
1172 rect.Height() / 2);
1173 return FX_ERR_Succeeded;
1174 }
1175
1176 FX_ERR CFX_Path::AddArc(FX_FLOAT left,
1177 FX_FLOAT top,
1178 FX_FLOAT width,
1179 FX_FLOAT height,
1180 FX_FLOAT startAngle,
1181 FX_FLOAT sweepAngle) {
1182 if (!m_generator)
1183 return FX_ERR_Property_Invalid;
1184 m_generator->AddArc(left + width / 2, top + height / 2, width / 2, height / 2,
1185 startAngle, sweepAngle);
1186 return FX_ERR_Succeeded;
1187 }
1188
1189 FX_ERR CFX_Path::AddPie(FX_FLOAT left,
1190 FX_FLOAT top,
1191 FX_FLOAT width,
1192 FX_FLOAT height,
1193 FX_FLOAT startAngle,
1194 FX_FLOAT sweepAngle) {
1195 if (!m_generator)
1196 return FX_ERR_Property_Invalid;
1197 m_generator->AddPie(left + width / 2, top + height / 2, width / 2, height / 2,
1198 startAngle, sweepAngle);
1199 return FX_ERR_Succeeded;
1200 }
1201
1202 FX_ERR CFX_Path::AddSubpath(CFX_Path* path) {
1203 if (!m_generator)
1204 return FX_ERR_Property_Invalid;
1205 m_generator->AddPathData(path->GetPathData());
1206 return FX_ERR_Succeeded;
1207 }
1208
1209 FX_ERR CFX_Path::Clear() {
1210 if (!m_generator)
1211 return FX_ERR_Property_Invalid;
1212 m_generator->GetPathData()->SetPointCount(0);
1213 return FX_ERR_Succeeded;
1214 }
1215
1216 FX_BOOL CFX_Path::IsEmpty() {
1217 if (!m_generator)
1218 return FX_ERR_Property_Invalid;
1219 if (m_generator->GetPathData()->GetPointCount() == 0) {
1220 return TRUE;
1221 }
1222 return FALSE;
1223 }
1224
1225 CFX_PathData* CFX_Path::GetPathData() {
1226 if (!m_generator)
1227 return nullptr;
1228 return m_generator->GetPathData();
1229 }
1230
1231 CFX_Color::CFX_Color() : m_type(FX_COLOR_None) {}
1232
1233 CFX_Color::CFX_Color(const FX_ARGB argb) {
1234 Set(argb);
1235 }
1236
1237 CFX_Color::CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb) {
1238 Set(pattern, argb);
1239 }
1240
1241 CFX_Color::CFX_Color(CFX_Shading* shading) {
1242 Set(shading);
1243 }
1244
1245 CFX_Color::~CFX_Color() {
1246 m_type = FX_COLOR_None;
1247 }
1248
1249 FX_ERR CFX_Color::Set(const FX_ARGB argb) {
1250 m_type = FX_COLOR_Solid;
1251 m_info.argb = argb;
1252 m_info.pattern = nullptr;
1253 return FX_ERR_Succeeded;
1254 }
1255
1256 FX_ERR CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) {
1257 if (!pattern)
1258 return FX_ERR_Parameter_Invalid;
1259 m_type = FX_COLOR_Pattern;
1260 m_info.argb = argb;
1261 m_info.pattern = pattern;
1262 return FX_ERR_Succeeded;
1263 }
1264
1265 FX_ERR CFX_Color::Set(CFX_Shading* shading) {
1266 if (!shading)
1267 return FX_ERR_Parameter_Invalid;
1268 m_type = FX_COLOR_Shading;
1269 m_shading = shading;
1270 return FX_ERR_Succeeded;
1271 }
1272
1273 CFX_Pattern::CFX_Pattern() {
1274 m_type = FX_PATTERN_None;
1275 m_matrix.SetIdentity();
1276 }
1277
1278 FX_ERR CFX_Pattern::Create(CFX_DIBitmap* bitmap,
1279 const FX_FLOAT xStep,
1280 const FX_FLOAT yStep,
1281 CFX_Matrix* matrix) {
1282 if (!bitmap)
1283 return FX_ERR_Parameter_Invalid;
1284 if (m_type != FX_PATTERN_None) {
1285 return FX_ERR_Property_Invalid;
1286 }
1287 m_type = FX_PATTERN_Bitmap;
1288 m_bitmapInfo.bitmap = bitmap;
1289 m_bitmapInfo.x1Step = xStep;
1290 m_bitmapInfo.y1Step = yStep;
1291 if (matrix) {
1292 m_matrix.Set(matrix->a, matrix->b, matrix->c, matrix->d, matrix->e,
1293 matrix->f);
1294 }
1295 return FX_ERR_Succeeded;
1296 }
1297
1298 FX_ERR CFX_Pattern::Create(FX_HatchStyle hatchStyle,
1299 const FX_ARGB foreArgb,
1300 const FX_ARGB backArgb,
1301 CFX_Matrix* matrix) {
1302 if (hatchStyle < FX_HATCHSTYLE_Horizontal ||
1303 hatchStyle > FX_HATCHSTYLE_SolidDiamond) {
1304 return FX_ERR_Parameter_Invalid;
1305 }
1306 if (m_type != FX_PATTERN_None) {
1307 return FX_ERR_Property_Invalid;
1308 }
1309 m_type = FX_PATTERN_Hatch;
1310 m_hatchInfo.hatchStyle = hatchStyle;
1311 m_hatchInfo.foreArgb = foreArgb;
1312 m_hatchInfo.backArgb = backArgb;
1313 if (matrix) {
1314 m_matrix.Set(matrix->a, matrix->b, matrix->c, matrix->d, matrix->e,
1315 matrix->f);
1316 }
1317 return FX_ERR_Succeeded;
1318 }
1319
1320 CFX_Pattern::~CFX_Pattern() {
1321 m_type = FX_PATTERN_None;
1322 }
1323
1324 CFX_Shading::CFX_Shading() {
1325 m_type = FX_SHADING_None;
1326 }
1327
1328 FX_ERR CFX_Shading::CreateAxial(const CFX_PointF& beginPoint,
1329 const CFX_PointF& endPoint,
1330 FX_BOOL isExtendedBegin,
1331 FX_BOOL isExtendedEnd,
1332 const FX_ARGB beginArgb,
1333 const FX_ARGB endArgb) {
1334 if (m_type != FX_SHADING_None) {
1335 return FX_ERR_Property_Invalid;
1336 }
1337 m_type = FX_SHADING_Axial;
1338 m_beginPoint = beginPoint;
1339 m_endPoint = endPoint;
1340 m_isExtendedBegin = isExtendedBegin;
1341 m_isExtendedEnd = isExtendedEnd;
1342 m_beginArgb = beginArgb;
1343 m_endArgb = endArgb;
1344 return InitArgbArray();
1345 }
1346
1347 FX_ERR CFX_Shading::CreateRadial(const CFX_PointF& beginPoint,
1348 const CFX_PointF& endPoint,
1349 const FX_FLOAT beginRadius,
1350 const FX_FLOAT endRadius,
1351 FX_BOOL isExtendedBegin,
1352 FX_BOOL isExtendedEnd,
1353 const FX_ARGB beginArgb,
1354 const FX_ARGB endArgb) {
1355 if (m_type != FX_SHADING_None) {
1356 return FX_ERR_Property_Invalid;
1357 }
1358 m_type = FX_SHADING_Radial;
1359 m_beginPoint = beginPoint;
1360 m_endPoint = endPoint;
1361 m_beginRadius = beginRadius;
1362 m_endRadius = endRadius;
1363 m_isExtendedBegin = isExtendedBegin;
1364 m_isExtendedEnd = isExtendedEnd;
1365 m_beginArgb = beginArgb;
1366 m_endArgb = endArgb;
1367 return InitArgbArray();
1368 }
1369
1370 CFX_Shading::~CFX_Shading() {
1371 m_type = FX_SHADING_None;
1372 }
1373
1374 FX_ERR CFX_Shading::InitArgbArray() {
1375 int32_t a1, r1, g1, b1;
1376 ArgbDecode(m_beginArgb, a1, r1, g1, b1);
1377 int32_t a2, r2, g2, b2;
1378 ArgbDecode(m_endArgb, a2, r2, g2, b2);
1379 FX_FLOAT f = (FX_FLOAT)(FX_SHADING_Steps - 1);
1380 FX_FLOAT aScale = (FX_FLOAT)(1.0 * (a2 - a1) / f);
1381 FX_FLOAT rScale = (FX_FLOAT)(1.0 * (r2 - r1) / f);
1382 FX_FLOAT gScale = (FX_FLOAT)(1.0 * (g2 - g1) / f);
1383 FX_FLOAT bScale = (FX_FLOAT)(1.0 * (b2 - b1) / f);
1384 int32_t a3, r3, g3, b3;
1385 for (int32_t i = 0; i < FX_SHADING_Steps; i++) {
1386 a3 = (int32_t)(i * aScale);
1387 r3 = (int32_t)(i * rScale);
1388 g3 = (int32_t)(i * gScale);
1389 b3 = (int32_t)(i * bScale);
1390 m_argbArray[i] =
1391 FXARGB_TODIB(FXARGB_MAKE((a1 + a3), (r1 + r3), (g1 + g3), (b1 + b3)));
1392 }
1393 return FX_ERR_Succeeded;
1394 }
OLDNEW
« no previous file with comments | « xfa/fxgraphics/cfx_color.cpp ('k') | xfa/fxgraphics/cfx_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698