1# Copyright 2018 The PDFium Authors. All rights reserved. 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 9config("fxge_warnings") { 10 visibility = [ ":*" ] 11 if (is_clang) { 12 cflags = [ 13 # http://code.google.com/p/pdfium/issues/detail?id=188 14 "-Wno-switch", 15 ] 16 } 17} 18 19source_set("fxge") { 20 sources = [ 21 "cfx_cliprgn.cpp", 22 "cfx_cliprgn.h", 23 "cfx_color.cpp", 24 "cfx_color.h", 25 "cfx_defaultrenderdevice.h", 26 "cfx_face.cpp", 27 "cfx_face.h", 28 "cfx_folderfontinfo.cpp", 29 "cfx_folderfontinfo.h", 30 "cfx_font.cpp", 31 "cfx_font.h", 32 "cfx_fontcache.cpp", 33 "cfx_fontcache.h", 34 "cfx_fontmapper.cpp", 35 "cfx_fontmapper.h", 36 "cfx_fontmgr.cpp", 37 "cfx_fontmgr.h", 38 "cfx_gemodule.cpp", 39 "cfx_gemodule.h", 40 "cfx_glyphbitmap.cpp", 41 "cfx_glyphbitmap.h", 42 "cfx_glyphcache.cpp", 43 "cfx_glyphcache.h", 44 "cfx_graphstate.cpp", 45 "cfx_graphstate.h", 46 "cfx_graphstatedata.cpp", 47 "cfx_graphstatedata.h", 48 "cfx_pathdata.cpp", 49 "cfx_pathdata.h", 50 "cfx_renderdevice.cpp", 51 "cfx_renderdevice.h", 52 "cfx_substfont.cpp", 53 "cfx_substfont.h", 54 "cfx_unicodeencoding.cpp", 55 "cfx_unicodeencoding.h", 56 "dib/cfx_bitmapcomposer.cpp", 57 "dib/cfx_bitmapcomposer.h", 58 "dib/cfx_bitmapstorer.cpp", 59 "dib/cfx_bitmapstorer.h", 60 "dib/cfx_cmyk_to_srgb.cpp", 61 "dib/cfx_cmyk_to_srgb.h", 62 "dib/cfx_dibbase.cpp", 63 "dib/cfx_dibbase.h", 64 "dib/cfx_dibitmap.cpp", 65 "dib/cfx_dibitmap.h", 66 "dib/cfx_imagerenderer.cpp", 67 "dib/cfx_imagerenderer.h", 68 "dib/cfx_imagestretcher.cpp", 69 "dib/cfx_imagestretcher.h", 70 "dib/cfx_imagetransformer.cpp", 71 "dib/cfx_imagetransformer.h", 72 "dib/cfx_scanlinecompositor.cpp", 73 "dib/cfx_scanlinecompositor.h", 74 "dib/cstretchengine.cpp", 75 "dib/cstretchengine.h", 76 "dib/fx_dib_main.cpp", 77 "dib/scanlinecomposer_iface.h", 78 "fontdata/chromefontdata/FoxitDingbats.cpp", 79 "fontdata/chromefontdata/FoxitFixed.cpp", 80 "fontdata/chromefontdata/FoxitFixedBold.cpp", 81 "fontdata/chromefontdata/FoxitFixedBoldItalic.cpp", 82 "fontdata/chromefontdata/FoxitFixedItalic.cpp", 83 "fontdata/chromefontdata/FoxitSans.cpp", 84 "fontdata/chromefontdata/FoxitSansBold.cpp", 85 "fontdata/chromefontdata/FoxitSansBoldItalic.cpp", 86 "fontdata/chromefontdata/FoxitSansItalic.cpp", 87 "fontdata/chromefontdata/FoxitSansMM.cpp", 88 "fontdata/chromefontdata/FoxitSerif.cpp", 89 "fontdata/chromefontdata/FoxitSerifBold.cpp", 90 "fontdata/chromefontdata/FoxitSerifBoldItalic.cpp", 91 "fontdata/chromefontdata/FoxitSerifItalic.cpp", 92 "fontdata/chromefontdata/FoxitSerifMM.cpp", 93 "fontdata/chromefontdata/FoxitSymbol.cpp", 94 "fontdata/chromefontdata/chromefontdata.h", 95 "freetype/fx_freetype.cpp", 96 "fx_dib.h", 97 "fx_font.cpp", 98 "fx_font.h", 99 "fx_freetype.h", 100 "fx_ge_fontmap.cpp", 101 "render_defines.h", 102 "renderdevicedriver_iface.cpp", 103 "renderdevicedriver_iface.h", 104 "scoped_font_transform.cpp", 105 "scoped_font_transform.h", 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 ":fxge_warnings", 116 "../../:pdfium_core_config", 117 ] 118 119 deps = [ "../fxcrt" ] 120 121 if (is_component_build || use_system_freetype) { 122 # ft_adobe_glyph_list is not exported from the Freetype shared library so we 123 # need it defined in component builds and builds using system freetype. 124 defines = [ "DEFINE_PS_TABLES_DATA" ] 125 } 126 127 if (pdf_enable_xfa) { 128 sources += [ 129 "cfx_unicodeencodingex.cpp", 130 "cfx_unicodeencodingex.h", 131 ] 132 } 133 134 if (pdf_use_skia || pdf_use_skia_paths) { 135 sources += [ "skia/fx_skia_device.cpp" ] 136 deps += [ "//skia" ] 137 } else { 138 sources += [ 139 "agg/fx_agg_driver.cpp", 140 "agg/fx_agg_driver.h", 141 ] 142 deps += [ "../../third_party:fx_agg" ] 143 } 144 145 if (is_android) { 146 sources += [ 147 "android/cfpf_skiadevicemodule.cpp", 148 "android/cfpf_skiadevicemodule.h", 149 "android/cfpf_skiafont.cpp", 150 "android/cfpf_skiafont.h", 151 "android/cfpf_skiafontmgr.cpp", 152 "android/cfpf_skiafontmgr.h", 153 "android/cfpf_skiapathfont.cpp", 154 "android/cfpf_skiapathfont.h", 155 "android/cfx_androidfontinfo.cpp", 156 "android/cfx_androidfontinfo.h", 157 "android/fx_android_imp.cpp", 158 ] 159 } 160 161 if (is_linux) { 162 sources += [ "fx_ge_linux.cpp" ] 163 } 164 165 if (is_mac) { 166 sources += [ 167 "apple/apple_int.h", 168 "apple/fx_apple_platform.cpp", 169 "apple/fx_mac_imp.cpp", 170 "apple/fx_quartz_device.cpp", 171 ] 172 libs = [ "CoreGraphics.framework" ] 173 } 174 175 if (is_win) { 176 sources += [ 177 "cfx_windowsrenderdevice.h", 178 "dib/cfx_dibextractor.cpp", 179 "dib/cfx_dibextractor.h", 180 "win32/cfx_psrenderer.cpp", 181 "win32/cfx_psrenderer.h", 182 "win32/cfx_windowsdib.h", 183 "win32/cpsoutput.cpp", 184 "win32/cpsoutput.h", 185 "win32/fx_win32_device.cpp", 186 "win32/fx_win32_dib.cpp", 187 "win32/fx_win32_gdipext.cpp", 188 "win32/fx_win32_print.cpp", 189 "win32/win32_int.h", 190 ] 191 configs -= [ "//build/config/win:lean_and_mean" ] 192 } 193 194 visibility = [ "../../*" ] 195} 196 197pdfium_unittest_source_set("unittests") { 198 sources = [ 199 "cfx_fontmapper_unittest.cpp", 200 "dib/cfx_cmyk_to_srgb_unittest.cpp", 201 "dib/cfx_dibitmap_unittest.cpp", 202 "dib/cstretchengine_unittest.cpp", 203 "fx_font_unittest.cpp", 204 ] 205 deps = [ 206 ":fxge", 207 "../fpdfapi/page", 208 "../fpdfapi/parser", 209 ] 210 pdfium_root_dir = "../../" 211} 212 213pdfium_embeddertest_source_set("embeddertests") { 214 sources = [ "fx_ge_text_embeddertest.cpp" ] 215 deps = [] 216 pdfium_root_dir = "../../" 217 218 if (pdf_use_skia || pdf_use_skia_paths) { 219 sources += [ "skia/fx_skia_device_embeddertest.cpp" ] 220 deps += [ 221 ":fxge", 222 "../../fpdfsdk", 223 "//skia", 224 ] 225 } 226 227 if (is_win) { 228 sources += [ "win32/fx_win32_device_embeddertest.cpp" ] 229 deps += [ 230 ":fxge", 231 "../fxcodec", 232 ] 233 } 234} 235