• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 The PDFium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/freetype/freetype.gni")
6import("../../pdfium.gni")
7import("../../testing/test.gni")
8
9source_set("fxge") {
10  sources = [
11    "agg/cfx_agg_bitmapcomposer.cpp",
12    "agg/cfx_agg_bitmapcomposer.h",
13    "agg/cfx_agg_cliprgn.cpp",
14    "agg/cfx_agg_cliprgn.h",
15    "agg/cfx_agg_devicedriver.cpp",
16    "agg/cfx_agg_devicedriver.h",
17    "agg/cfx_agg_imagerenderer.cpp",
18    "agg/cfx_agg_imagerenderer.h",
19    "calculate_pitch.cpp",
20    "calculate_pitch.h",
21    "cfx_color.cpp",
22    "cfx_color.h",
23    "cfx_defaultrenderdevice.cpp",
24    "cfx_defaultrenderdevice.h",
25    "cfx_drawutils.cpp",
26    "cfx_drawutils.h",
27    "cfx_face.cpp",
28    "cfx_face.h",
29    "cfx_fillrenderoptions.h",
30    "cfx_folderfontinfo.cpp",
31    "cfx_folderfontinfo.h",
32    "cfx_font.cpp",
33    "cfx_font.h",
34    "cfx_fontcache.cpp",
35    "cfx_fontcache.h",
36    "cfx_fontmapper.cpp",
37    "cfx_fontmapper.h",
38    "cfx_fontmgr.cpp",
39    "cfx_fontmgr.h",
40    "cfx_gemodule.cpp",
41    "cfx_gemodule.h",
42    "cfx_glyphbitmap.cpp",
43    "cfx_glyphbitmap.h",
44    "cfx_glyphcache.cpp",
45    "cfx_glyphcache.h",
46    "cfx_graphstate.cpp",
47    "cfx_graphstate.h",
48    "cfx_graphstatedata.cpp",
49    "cfx_graphstatedata.h",
50    "cfx_path.cpp",
51    "cfx_path.h",
52    "cfx_renderdevice.cpp",
53    "cfx_renderdevice.h",
54    "cfx_substfont.cpp",
55    "cfx_substfont.h",
56    "cfx_textrenderoptions.h",
57    "cfx_unicodeencoding.cpp",
58    "cfx_unicodeencoding.h",
59    "dib/blend.cpp",
60    "dib/blend.h",
61    "dib/cfx_bitmapstorer.cpp",
62    "dib/cfx_bitmapstorer.h",
63    "dib/cfx_cmyk_to_srgb.cpp",
64    "dib/cfx_cmyk_to_srgb.h",
65    "dib/cfx_dibbase.cpp",
66    "dib/cfx_dibbase.h",
67    "dib/cfx_dibitmap.cpp",
68    "dib/cfx_dibitmap.h",
69    "dib/cfx_imagestretcher.cpp",
70    "dib/cfx_imagestretcher.h",
71    "dib/cfx_imagetransformer.cpp",
72    "dib/cfx_imagetransformer.h",
73    "dib/cfx_scanlinecompositor.cpp",
74    "dib/cfx_scanlinecompositor.h",
75    "dib/cstretchengine.cpp",
76    "dib/cstretchengine.h",
77    "dib/fx_dib.cpp",
78    "dib/fx_dib.h",
79    "dib/scanlinecomposer_iface.h",
80    "fontdata/chromefontdata/FoxitDingbats.cpp",
81    "fontdata/chromefontdata/FoxitFixed.cpp",
82    "fontdata/chromefontdata/FoxitFixedBold.cpp",
83    "fontdata/chromefontdata/FoxitFixedBoldItalic.cpp",
84    "fontdata/chromefontdata/FoxitFixedItalic.cpp",
85    "fontdata/chromefontdata/FoxitSans.cpp",
86    "fontdata/chromefontdata/FoxitSansBold.cpp",
87    "fontdata/chromefontdata/FoxitSansBoldItalic.cpp",
88    "fontdata/chromefontdata/FoxitSansItalic.cpp",
89    "fontdata/chromefontdata/FoxitSansMM.cpp",
90    "fontdata/chromefontdata/FoxitSerif.cpp",
91    "fontdata/chromefontdata/FoxitSerifBold.cpp",
92    "fontdata/chromefontdata/FoxitSerifBoldItalic.cpp",
93    "fontdata/chromefontdata/FoxitSerifItalic.cpp",
94    "fontdata/chromefontdata/FoxitSerifMM.cpp",
95    "fontdata/chromefontdata/FoxitSymbol.cpp",
96    "fontdata/chromefontdata/chromefontdata.h",
97    "freetype/fx_freetype.cpp",
98    "freetype/fx_freetype.h",
99    "fx_font.cpp",
100    "fx_font.h",
101    "fx_fontencoding.h",
102    "render_defines.h",
103    "renderdevicedriver_iface.cpp",
104    "renderdevicedriver_iface.h",
105    "scoped_font_transform.cpp",
106    "scoped_font_transform.h",
107    "systemfontinfo_iface.h",
108    "text_char_pos.cpp",
109    "text_char_pos.h",
110    "text_glyph_pos.cpp",
111    "text_glyph_pos.h",
112  ]
113
114  configs += [
115    "../../:pdfium_strict_config",
116    "../../:pdfium_noshorten_config",
117  ]
118
119  deps = [
120    "../../third_party:fx_agg",
121    "../fxcrt",
122  ]
123
124  public_deps = []
125
126  if (is_component_build || use_system_freetype) {
127    # ft_adobe_glyph_list is not exported from the Freetype shared library so we
128    # need it defined in component builds and builds using system freetype.
129    defines = [ "DEFINE_PS_TABLES_DATA" ]
130  }
131
132  if (pdf_enable_xfa) {
133    sources += [
134      "cfx_unicodeencodingex.cpp",
135      "cfx_unicodeencodingex.h",
136    ]
137  }
138
139  if (pdf_use_skia) {
140    sources += [
141      "skia/cfx_dibbase_skia.cpp",
142      "skia/fx_skia_device.cpp",
143    ]
144    public_deps += [ "//skia" ]
145  }
146
147  if (is_android) {
148    sources += [
149      "android/cfpf_skiadevicemodule.cpp",
150      "android/cfpf_skiadevicemodule.h",
151      "android/cfpf_skiafont.cpp",
152      "android/cfpf_skiafont.h",
153      "android/cfpf_skiafontmgr.cpp",
154      "android/cfpf_skiafontmgr.h",
155      "android/cfpf_skiapathfont.cpp",
156      "android/cfpf_skiapathfont.h",
157      "android/cfx_androidfontinfo.cpp",
158      "android/cfx_androidfontinfo.h",
159      "android/fx_android_impl.cpp",
160    ]
161  }
162
163  if (is_linux || is_chromeos) {
164    sources += [ "linux/fx_linux_impl.cpp" ]
165  }
166
167  if (is_mac) {
168    sources += [
169      "apple/fx_apple_impl.cpp",
170      "apple/fx_apple_platform.cpp",
171      "apple/fx_apple_platform.h",
172      "apple/fx_quartz_device.cpp",
173      "apple/fx_quartz_device.h",
174    ]
175    frameworks = [ "CoreGraphics.framework" ]
176  }
177
178  if (is_win) {
179    sources += [
180      "cfx_windowsrenderdevice.cpp",
181      "cfx_windowsrenderdevice.h",
182      "win32/cfx_psfonttracker.cpp",
183      "win32/cfx_psfonttracker.h",
184      "win32/cfx_psrenderer.cpp",
185      "win32/cfx_psrenderer.h",
186      "win32/cgdi_device_driver.cpp",
187      "win32/cgdi_device_driver.h",
188      "win32/cgdi_display_driver.cpp",
189      "win32/cgdi_display_driver.h",
190      "win32/cgdi_plus_ext.cpp",
191      "win32/cgdi_plus_ext.h",
192      "win32/cgdi_printer_driver.cpp",
193      "win32/cgdi_printer_driver.h",
194      "win32/cps_printer_driver.cpp",
195      "win32/cps_printer_driver.h",
196      "win32/cpsoutput.cpp",
197      "win32/cpsoutput.h",
198      "win32/ctext_only_printer_driver.cpp",
199      "win32/ctext_only_printer_driver.h",
200      "win32/cwin32_platform.cpp",
201      "win32/cwin32_platform.h",
202    ]
203    configs -= [ "//build/config/win:lean_and_mean" ]
204  }
205
206  visibility = [ "../../*" ]
207}
208
209pdfium_unittest_source_set("unittests") {
210  sources = [
211    "cfx_defaultrenderdevice_unittest.cpp",
212    "cfx_folderfontinfo_unittest.cpp",
213    "cfx_fontmapper_unittest.cpp",
214    "cfx_path_unittest.cpp",
215    "dib/blend_unittest.cpp",
216    "dib/cfx_cmyk_to_srgb_unittest.cpp",
217    "dib/cfx_dibbase_unittest.cpp",
218    "dib/cfx_dibitmap_unittest.cpp",
219    "dib/cfx_scanlinecompositor_unittest.cpp",
220    "dib/cstretchengine_unittest.cpp",
221    "dib/fx_dib_unittest.cpp",
222    "fx_font_unittest.cpp",
223  ]
224  deps = [
225    ":fxge",
226    "../fpdfapi/page",
227    "../fpdfapi/parser",
228  ]
229  pdfium_root_dir = "../../"
230
231  if (is_win) {
232    sources += [ "win32/cfx_psrenderer_unittest.cpp" ]
233  }
234}
235
236pdfium_embeddertest_source_set("embeddertests") {
237  sources = [ "fx_ge_text_embeddertest.cpp" ]
238  deps = []
239  pdfium_root_dir = "../../"
240
241  if (pdf_use_skia) {
242    sources += [ "skia/fx_skia_device_embeddertest.cpp" ]
243    deps += [
244      ":fxge",
245      "../../fpdfsdk",
246      "../fpdfapi/page",
247      "../fpdfapi/render",
248      "//skia",
249    ]
250  }
251
252  if (is_win) {
253    sources += [ "cfx_windowsrenderdevice_embeddertest.cpp" ]
254    deps += [
255      ":fxge",
256      "../fxcodec",
257    ]
258  }
259}
260