xref: /aosp_15_r20/external/pdfium/third_party/agg23/0008-namespace.patch (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1diff --git a/third_party/agg23/agg_array.h b/third_party/agg23/agg_array.h
2index fba41a7eb..b82d95296 100644
3--- a/third_party/agg23/agg_array.h
4+++ b/third_party/agg23/agg_array.h
5@@ -19,6 +19,8 @@
6 #include "agg_basics.h"
7 #include "core/fxcrt/fx_memory.h"  // For FXSYS_* macros.
8
9+namespace pdfium
10+{
11 namespace agg
12 {
13 template <class T>
14@@ -499,4 +501,5 @@ template<class T> inline void swap_elements(T& a, T& b)
15     b = temp;
16 }
17 }
18+}  // namespace pdfium
19 #endif
20diff --git a/third_party/agg23/agg_basics.h b/third_party/agg23/agg_basics.h
21index 2a1c2af2f..eb6f35686 100644
22--- a/third_party/agg23/agg_basics.h
23+++ b/third_party/agg23/agg_basics.h
24@@ -43,6 +43,8 @@
25
26 #include "core/fxcrt/fx_system.h"
27
28+namespace pdfium
29+{
30 namespace agg
31 {
32 typedef AGG_INT8   int8;
33@@ -274,4 +276,5 @@ struct vertex_type  {
34         x(x_), y(y_), cmd(cmd_) {}
35 };
36 }
37+}  // namespace pdfium
38 #endif
39diff --git a/third_party/agg23/agg_clip_liang_barsky.h b/third_party/agg23/agg_clip_liang_barsky.h
40index 31b35fe96..7b865fd20 100644
41--- a/third_party/agg23/agg_clip_liang_barsky.h
42+++ b/third_party/agg23/agg_clip_liang_barsky.h
43@@ -21,6 +21,8 @@
44 #define AGG_CLIP_LIANG_BARSKY_INCLUDED
45 #include "agg_basics.h"
46 #include "third_party/base/numerics/safe_math.h"
47+namespace pdfium
48+{
49 namespace agg
50 {
51 template<class T>
52@@ -133,4 +135,5 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
53     return np;
54 }
55 }
56+}  // namespace pdfium
57 #endif
58diff --git a/third_party/agg23/agg_color_gray.h b/third_party/agg23/agg_color_gray.h
59index 5db7bcaf2..c1b6eabd0 100644
60--- a/third_party/agg23/agg_color_gray.h
61+++ b/third_party/agg23/agg_color_gray.h
62@@ -28,6 +28,8 @@
63 #ifndef AGG_COLOR_GRAY_INCLUDED
64 #define AGG_COLOR_GRAY_INCLUDED
65 #include "agg_basics.h"
66+namespace pdfium
67+{
68 namespace agg
69 {
70 struct gray8 {
71@@ -47,4 +49,5 @@ struct gray8 {
72         v(int8u(v_)), a(int8u(a_)) {}
73 };
74 }
75+}  // namespace pdfium
76 #endif
77diff --git a/third_party/agg23/agg_conv_adaptor_vcgen.h b/third_party/agg23/agg_conv_adaptor_vcgen.h
78index be4dc2d60..343c4e10b 100644
79--- a/third_party/agg23/agg_conv_adaptor_vcgen.h
80+++ b/third_party/agg23/agg_conv_adaptor_vcgen.h
81@@ -16,6 +16,8 @@
82 #ifndef AGG_CONV_ADAPTOR_VCGEN_INCLUDED
83 #define AGG_CONV_ADAPTOR_VCGEN_INCLUDED
84 #include "agg_basics.h"
85+namespace pdfium
86+{
87 namespace agg
88 {
89 struct null_markers  {
90@@ -135,4 +137,5 @@ unsigned conv_adaptor_vcgen<VertexSource, Generator, Markers>::vertex(float* x,
91     return cmd;
92 }
93 }
94+}  // namespace pdfium
95 #endif
96diff --git a/third_party/agg23/agg_conv_dash.h b/third_party/agg23/agg_conv_dash.h
97index f87eccc3b..3a45d5563 100644
98--- a/third_party/agg23/agg_conv_dash.h
99+++ b/third_party/agg23/agg_conv_dash.h
100@@ -22,6 +22,8 @@
101 #include "agg_basics.h"
102 #include "agg_vcgen_dash.h"
103 #include "agg_conv_adaptor_vcgen.h"
104+namespace pdfium
105+{
106 namespace agg
107 {
108 template<class VertexSource, class Markers = null_markers>
109@@ -58,4 +60,5 @@ private:
110     operator = (const conv_dash<VertexSource, Markers>&);
111 };
112 }
113+}  // namespace pdfium
114 #endif
115diff --git a/third_party/agg23/agg_conv_stroke.h b/third_party/agg23/agg_conv_stroke.h
116index 82268ddec..a65fe3e48 100644
117--- a/third_party/agg23/agg_conv_stroke.h
118+++ b/third_party/agg23/agg_conv_stroke.h
119@@ -22,6 +22,8 @@
120 #include "agg_basics.h"
121 #include "agg_vcgen_stroke.h"
122 #include "agg_conv_adaptor_vcgen.h"
123+namespace pdfium
124+{
125 namespace agg
126 {
127 template<class VertexSource, class Markers = null_markers>
128@@ -107,4 +109,5 @@ private:
129     operator = (const conv_stroke<VertexSource, Markers>&);
130 };
131 }
132+}  // namespace pdfium
133 #endif
134diff --git a/third_party/agg23/agg_curves.cpp b/third_party/agg23/agg_curves.cpp
135index 41900c81f..be89752e0 100644
136--- a/third_party/agg23/agg_curves.cpp
137+++ b/third_party/agg23/agg_curves.cpp
138@@ -22,6 +22,8 @@
139 #include "agg_curves.h"
140 #include "agg_math.h"
141
142+namespace pdfium
143+{
144 namespace agg
145 {
146 const float curve_collinearity_epsilon              = 1e-30f;
147@@ -107,3 +109,4 @@ void curve4_div::bezier(float x1, float y1,
148     m_points.add(point_type(x4, y4));
149 }
150 }
151+}  // namespace pdfium
152diff --git a/third_party/agg23/agg_curves.h b/third_party/agg23/agg_curves.h
153index 488db4a1f..908bd9a5a 100644
154--- a/third_party/agg23/agg_curves.h
155+++ b/third_party/agg23/agg_curves.h
156@@ -17,6 +17,8 @@
157 #ifndef AGG_CURVES_INCLUDED
158 #define AGG_CURVES_INCLUDED
159 #include "agg_array.h"
160+namespace pdfium
161+{
162 namespace agg
163 {
164 struct curve4_points  {
165@@ -185,4 +187,5 @@ private:
166     curve4_div m_curve_div;
167 };
168 }
169+}  // namespace pdfium
170 #endif
171diff --git a/third_party/agg23/agg_math.h b/third_party/agg23/agg_math.h
172index 6d5e39ac3..15617b2e8 100644
173--- a/third_party/agg23/agg_math.h
174+++ b/third_party/agg23/agg_math.h
175@@ -19,6 +19,8 @@
176 #ifndef AGG_MATH_INCLUDED
177 #define AGG_MATH_INCLUDED
178 #include "agg_basics.h"
179+namespace pdfium
180+{
181 namespace agg
182 {
183 const float intersection_epsilon = 1.0e-30f;
184@@ -60,4 +62,5 @@ AGG_INLINE bool calc_intersection(float ax, float ay, float bx, float by,
185     return true;
186 }
187 }
188+}  // namespace pdfium
189 #endif
190diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
191index 82df8080c..8515d2b16 100644
192--- a/third_party/agg23/agg_math_stroke.h
193+++ b/third_party/agg23/agg_math_stroke.h
194@@ -21,6 +21,8 @@
195 #define AGG_STROKE_MATH_INCLUDED
196 #include "agg_math.h"
197 #include "agg_vertex_sequence.h"
198+namespace pdfium
199+{
200 namespace agg
201 {
202 enum line_cap_e {
203@@ -270,4 +272,5 @@ void stroke_calc_join(VertexConsumer& out_vertices,
204     }
205 }
206 }
207+}  // namespace pdfium
208 #endif
209diff --git a/third_party/agg23/agg_path_storage.cpp b/third_party/agg23/agg_path_storage.cpp
210index 063ece542..2cd0caed1 100644
211--- a/third_party/agg23/agg_path_storage.cpp
212+++ b/third_party/agg23/agg_path_storage.cpp
213@@ -28,6 +28,8 @@
214 #include "agg_math.h"
215 #include "core/fxcrt/fx_memory.h"
216
217+namespace pdfium
218+{
219 namespace agg
220 {
221 path_storage::~path_storage()
222@@ -95,3 +97,4 @@ void path_storage::end_poly()
223     }
224 }
225 }
226+}  // namespace pdfium
227diff --git a/third_party/agg23/agg_path_storage.h b/third_party/agg23/agg_path_storage.h
228index 17e82d73e..55d6df001 100644
229--- a/third_party/agg23/agg_path_storage.h
230+++ b/third_party/agg23/agg_path_storage.h
231@@ -16,6 +16,8 @@
232 #ifndef AGG_PATH_STORAGE_INCLUDED
233 #define AGG_PATH_STORAGE_INCLUDED
234 #include "agg_basics.h"
235+namespace pdfium
236+{
237 namespace agg
238 {
239 class path_storage
240@@ -169,4 +171,5 @@ inline void path_storage::line_to(float x, float y)
241     add_vertex(x, y, path_cmd_line_to);
242 }
243 }
244+}  // namespace pdfium
245 #endif
246diff --git a/third_party/agg23/agg_pixfmt_gray.h b/third_party/agg23/agg_pixfmt_gray.h
247index 5a8093547..561bb7179 100644
248--- a/third_party/agg23/agg_pixfmt_gray.h
249+++ b/third_party/agg23/agg_pixfmt_gray.h
250@@ -26,6 +26,8 @@
251 #include "agg_basics.h"
252 #include "agg_color_gray.h"
253 #include "agg_rendering_buffer.h"
254+namespace pdfium
255+{
256 namespace agg
257 {
258 template<class ColorT> struct blender_gray  {
259@@ -174,4 +176,5 @@ private:
260 typedef blender_gray<gray8>      blender_gray8;
261 typedef pixel_formats_gray<blender_gray8, 1, 0> pixfmt_gray8;
262 }
263+}  // namespace pdfium
264 #endif
265diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.cpp b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
266index 7850225d1..d2b6a46e4 100644
267--- a/third_party/agg23/agg_rasterizer_scanline_aa.cpp
268+++ b/third_party/agg23/agg_rasterizer_scanline_aa.cpp
269@@ -49,6 +49,8 @@
270 #include <limits.h>
271 #include "agg_rasterizer_scanline_aa.h"
272 #include "third_party/base/numerics/safe_math.h"
273+namespace pdfium
274+{
275 namespace agg
276 {
277 AGG_INLINE void cell_aa::set_cover(int c, int a)
278@@ -515,3 +517,4 @@ bool rasterizer_scanline_aa::safe_add(int* op1, int op2)
279     return true;
280 }
281 }
282+}  // namespace pdfium
283diff --git a/third_party/agg23/agg_rasterizer_scanline_aa.h b/third_party/agg23/agg_rasterizer_scanline_aa.h
284index eade78333..133d66c4f 100644
285--- a/third_party/agg23/agg_rasterizer_scanline_aa.h
286+++ b/third_party/agg23/agg_rasterizer_scanline_aa.h
287@@ -38,6 +38,8 @@
288 #include "core/fxcrt/fx_coordinates.h"
289 #include "core/fxcrt/fx_memory.h"
290
291+namespace pdfium
292+{
293 namespace agg
294 {
295 enum poly_base_scale_e {
296@@ -495,4 +497,5 @@ private:
297     int            m_cur_y;
298 };
299 }
300+}  // namespace pdfium
301 #endif
302diff --git a/third_party/agg23/agg_render_scanlines.h b/third_party/agg23/agg_render_scanlines.h
303index 0dfd6d259..03ec683eb 100644
304--- a/third_party/agg23/agg_render_scanlines.h
305+++ b/third_party/agg23/agg_render_scanlines.h
306@@ -16,6 +16,8 @@
307 #ifndef AGG_RENDER_SCANLINES_INCLUDED
308 #define AGG_RENDER_SCANLINES_INCLUDED
309 #include "agg_basics.h"
310+namespace pdfium
311+{
312 namespace agg
313 {
314 template<class Rasterizer, class Scanline, class Renderer>
315@@ -47,4 +49,5 @@ void render_all_paths(Rasterizer& ras,
316     }
317 }
318 }
319+}  // namespace pdfium
320 #endif
321diff --git a/third_party/agg23/agg_renderer_base.h b/third_party/agg23/agg_renderer_base.h
322index bd1b203b9..d637be262 100644
323--- a/third_party/agg23/agg_renderer_base.h
324+++ b/third_party/agg23/agg_renderer_base.h
325@@ -21,6 +21,8 @@
326 #define AGG_RENDERER_BASE_INCLUDED
327 #include "agg_basics.h"
328 #include "agg_rendering_buffer.h"
329+namespace pdfium
330+{
331 namespace agg
332 {
333 template<class PixelFormat> class renderer_base
334@@ -160,4 +162,5 @@ private:
335     rect         m_clip_box;
336 };
337 }
338+}  // namespace pdfium
339 #endif
340diff --git a/third_party/agg23/agg_renderer_scanline.h b/third_party/agg23/agg_renderer_scanline.h
341index 62d104f7f..32db738d3 100644
342--- a/third_party/agg23/agg_renderer_scanline.h
343+++ b/third_party/agg23/agg_renderer_scanline.h
344@@ -18,6 +18,8 @@
345 #include "agg_basics.h"
346 #include "agg_renderer_base.h"
347 #include "agg_render_scanlines.h"
348+namespace pdfium
349+{
350 namespace agg
351 {
352 template<class BaseRenderer, class SpanGenerator> class renderer_scanline_aa
353@@ -90,4 +92,5 @@ private:
354     SpanGenerator* m_span_gen;
355 };
356 }
357+}  // namespace pdfium
358 #endif
359diff --git a/third_party/agg23/agg_rendering_buffer.h b/third_party/agg23/agg_rendering_buffer.h
360index 9c1c0c689..4c80160b7 100644
361--- a/third_party/agg23/agg_rendering_buffer.h
362+++ b/third_party/agg23/agg_rendering_buffer.h
363@@ -20,6 +20,8 @@
364 #ifndef AGG_RENDERING_BUFFER_INCLUDED
365 #define AGG_RENDERING_BUFFER_INCLUDED
366 #include "agg_basics.h"
367+namespace pdfium
368+{
369 namespace agg
370 {
371 class rendering_buffer
372@@ -142,4 +144,5 @@ private:
373     unsigned m_max_height;
374 };
375 }
376+}  // namespace pdfium
377 #endif
378diff --git a/third_party/agg23/agg_scanline_u.h b/third_party/agg23/agg_scanline_u.h
379index 844dc9aad..1db31c3e3 100644
380--- a/third_party/agg23/agg_scanline_u.h
381+++ b/third_party/agg23/agg_scanline_u.h
382@@ -24,6 +24,8 @@
383 #ifndef AGG_SCANLINE_U_INCLUDED
384 #define AGG_SCANLINE_U_INCLUDED
385 #include "agg_array.h"
386+namespace pdfium
387+{
388 namespace agg
389 {
390 template<class CoverT> class scanline_u
391@@ -147,4 +149,5 @@ private:
392 };
393 typedef scanline_u<int8u> scanline_u8;
394 }
395+}  // namespace pdfium
396 #endif
397diff --git a/third_party/agg23/agg_shorten_path.h b/third_party/agg23/agg_shorten_path.h
398index 2f62ec52d..280d1688e 100644
399--- a/third_party/agg23/agg_shorten_path.h
400+++ b/third_party/agg23/agg_shorten_path.h
401@@ -17,6 +17,8 @@
402 #define AGG_SHORTEN_PATH_INCLUDED
403 #include "agg_basics.h"
404 #include "agg_vertex_sequence.h"
405+namespace pdfium
406+{
407 namespace agg
408 {
409 template<class VertexSequence>
410@@ -54,4 +56,5 @@ void shorten_path(VertexSequence& vs, float s, unsigned closed = 0)
411     }
412 }
413 }
414+}  // namespace pdfium
415 #endif
416diff --git a/third_party/agg23/agg_vcgen_dash.cpp b/third_party/agg23/agg_vcgen_dash.cpp
417index fdbd2aa7f..f690760b0 100644
418--- a/third_party/agg23/agg_vcgen_dash.cpp
419+++ b/third_party/agg23/agg_vcgen_dash.cpp
420@@ -21,6 +21,8 @@
421 #include "agg_shorten_path.h"
422 #include "agg_vcgen_dash.h"
423
424+namespace pdfium
425+{
426 namespace agg
427 {
428 vcgen_dash::vcgen_dash() :
429@@ -175,3 +177,4 @@ unsigned vcgen_dash::vertex(float* x, float* y)
430     return path_cmd_stop;
431 }
432 }
433+}  // namespace pdfium
434diff --git a/third_party/agg23/agg_vcgen_dash.h b/third_party/agg23/agg_vcgen_dash.h
435index 7702fa7ad..2a4c94eab 100644
436--- a/third_party/agg23/agg_vcgen_dash.h
437+++ b/third_party/agg23/agg_vcgen_dash.h
438@@ -21,6 +21,8 @@
439 #define AGG_VCGEN_DASH_INCLUDED
440 #include "agg_basics.h"
441 #include "agg_vertex_sequence.h"
442+namespace pdfium
443+{
444 namespace agg
445 {
446 class vcgen_dash
447@@ -72,4 +74,5 @@ private:
448     unsigned       m_src_vertex;
449 };
450 }
451+}  // namespace pdfium
452 #endif
453diff --git a/third_party/agg23/agg_vcgen_stroke.cpp b/third_party/agg23/agg_vcgen_stroke.cpp
454index 3e97a3147..f65eac55f 100644
455--- a/third_party/agg23/agg_vcgen_stroke.cpp
456+++ b/third_party/agg23/agg_vcgen_stroke.cpp
457@@ -25,6 +25,8 @@
458
459 #include "agg_vcgen_stroke.h"
460
461+namespace pdfium
462+{
463 namespace agg
464 {
465
466@@ -212,3 +214,4 @@ unsigned vcgen_stroke::vertex(float* x, float* y)
467     return cmd;
468 }
469 }
470+}  // namespace pdfium
471diff --git a/third_party/agg23/agg_vcgen_stroke.h b/third_party/agg23/agg_vcgen_stroke.h
472index 23142d37f..ed9bb416f 100644
473--- a/third_party/agg23/agg_vcgen_stroke.h
474+++ b/third_party/agg23/agg_vcgen_stroke.h
475@@ -16,6 +16,8 @@
476 #ifndef AGG_VCGEN_STROKE_INCLUDED
477 #define AGG_VCGEN_STROKE_INCLUDED
478 #include "agg_math_stroke.h"
479+namespace pdfium
480+{
481 namespace agg
482 {
483 class vcgen_stroke
484@@ -117,4 +119,5 @@ private:
485     unsigned       m_out_vertex;
486 };
487 }
488+}  // namespace pdfium
489 #endif
490diff --git a/third_party/agg23/agg_vertex_sequence.h b/third_party/agg23/agg_vertex_sequence.h
491index 80eabbb95..dc729d55c 100644
492--- a/third_party/agg23/agg_vertex_sequence.h
493+++ b/third_party/agg23/agg_vertex_sequence.h
494@@ -22,6 +22,8 @@
495 #include "agg_basics.h"
496 #include "agg_array.h"
497 #include "agg_math.h"
498+namespace pdfium
499+{
500 namespace agg
501 {
502 template<class T, unsigned S = 6>
503@@ -97,4 +99,5 @@ struct vertex_dist_cmd : public vertex_dist {
504     }
505 };
506 }
507+}  // namespace pdfium
508 #endif
509