Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Description: | 1 # Description: |
| 2 # Skia graphics library. | 2 # Skia graphics library. |
| 3 # | 3 # |
| 4 # Definitions for Google BUILD file. | 4 # Definitions for Google BUILD file. |
| 5 | 5 |
| 6 exports_files(["BUILD.public"]) | 6 exports_files(["BUILD.public"]) |
| 7 | 7 |
| 8 # Platform-independent SRCS | 8 # Platform-independent SRCS |
| 9 SRCS = glob( | 9 SRCS = glob( |
| 10 [ | 10 [ |
| 11 "include/private/*.h", | 11 "include/private/*.h", |
| 12 "google/*.cpp", | 12 "src/**/*.h", |
| 13 "src/c/*.cpp", | 13 "src/**/*.cpp", |
| 14 "src/core/*.cpp", | 14 "src/**/*.c", |
| 15 "src/device/*.cpp", | |
| 16 "src/doc/*.cpp", | |
| 17 "src/effects/*.cpp", | |
| 18 "src/effects/gradients/*.cpp", | |
| 19 "src/image/*.cpp", | |
| 20 "src/images/*.cpp", | |
| 21 "src/lazy/*.cpp", | |
| 22 "src/pathops/*.cpp", | |
| 23 "src/pdf/*.cpp", | |
| 24 "src/pipe/*.cpp", | |
| 25 "src/sfnt/*.cpp", | |
| 26 "src/utils/*.cpp", | |
| 27 "src/gpu/*.cpp", | |
| 28 "src/gpu/effects/*.cpp", | |
| 29 "src/gpu/gl/*.cpp", | |
| 30 "src/gpu/gl/builders/*.cpp", | |
| 31 "src/gpu/gl/debug/*.cpp", | |
| 32 "src/gpu/gl/glx/*.cpp", | |
| 33 "src/opts/opts_check_x86.cpp", | |
| 34 "src/opts/*SSE2*.cpp", | |
| 35 "src/opts/*sse2*.cpp", | |
| 36 "src/opts/SkTextureCompression_opts_none.cpp", | |
| 37 | |
| 38 # TODO(mtklein): might be more maintainable with a blacklist instead? | |
| 39 "src/ports/SkBarriers_x86.cpp", | |
| 40 "src/ports/SkDebug_stdio.cpp", | |
| 41 "src/ports/SkDiscardableMemory_none.cpp", | |
| 42 "src/ports/SkFontHost_linux.cpp", | |
| 43 "src/ports/SkFontHost_FreeType.cpp", | |
| 44 "src/ports/SkFontHost_FreeType_common.cpp", | |
| 45 "src/ports/SkGlobalInitialization_default.cpp", | |
| 46 "src/ports/SkImageGenerator_skia.cpp", | |
| 47 "src/ports/SkMemory_malloc.cpp", | |
| 48 "src/ports/SkMutex_pthread.h", | |
| 49 "src/ports/SkOSFile_posix.cpp", | |
| 50 "src/ports/SkOSFile_stdio.cpp", | |
| 51 "src/ports/SkTLS_pthread.cpp", | |
| 52 "src/ports/SkTime_Unix.cpp", | |
| 53 | 15 |
| 54 # Third Party | 16 # Third Party |
| 55 "third_party/etc1/*.cpp", | 17 "third_party/etc1/*.cpp", |
| 18 "third_party/etc1/*.h", | |
| 56 "third_party/ktx/*.cpp", | 19 "third_party/ktx/*.cpp", |
| 20 "third_party/ktx/*.h", | |
| 57 ], | 21 ], |
| 58 exclude = [ | 22 exclude = [ |
|
mtklein
2015/10/14 18:45:17
This list might be easier to follow with some sort
dogben
2015/10/14 23:11:05
Done.
| |
| 59 "src/pdf/SkPDFFont.cpp", # Wrapped by google/SkPDFFont_sfntly.cpp | 23 # Exclude platform-dependent files. |
| 60 "src/gpu/gl/GrGLDefaultInterface_none.cpp", | 24 "src/opts/**/*", |
| 61 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", | 25 "src/ports/**/*", |
| 26 "src/gpu/gl/android/*", | |
| 27 "src/gpu/gl/iOS/*", | |
| 28 "src/gpu/gl/mac/*", | |
| 29 "src/gpu/gl/win/*", | |
| 30 "src/utils/android/**/*", | |
| 31 "src/utils/mac/**/*", | |
| 32 "src/utils/win/**/*", | |
| 33 "src/views/sdl/*", | |
| 34 "src/views/win/*", | |
| 35 "src/views/unix/*", | |
| 36 # Exclude multiple definitions. | |
| 37 # TODO(mtklein): Move to opts? | |
| 38 "src/fonts/*fontconfig*", | |
| 39 "src/gpu/gl/egl/*", # Conflicts with gpu/gl/glx. | |
| 40 "src/gpu/gl/nacl/*", # Conflicts with gpu/gl/glx. | |
| 41 "src/gpu/gl/GrGLDefaultInterface_none.cpp", # Conflicts with src/gpu/gl /GrGLDefaultInterface_native.cpp | |
| 42 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", # Conflicts with src/g pu/gl/glx/GrGLCreateNativeInterface_glx.cpp | |
| 43 # Exclude files that don't compile with the current DEFINES. | |
| 44 # TODO(mtklein): Should these be fixed upstream? | |
|
mtklein
2015/10/14 18:45:17
These are mostly working as intended I think. A l
dogben
2015/10/14 23:11:05
Done.
| |
| 45 "src/device/xps/*", # Missing header ObjBase.h. | |
|
mtklein
2015/10/14 18:45:16
(Windows-only.)
dogben
2015/10/14 23:11:05
Done.
| |
| 46 "src/gpu/gl/angle/*", # Requires SK_ANGLE define. | |
| 47 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' | |
| 48 "src/gpu/gl/mesa/*", # Requires SK_MESA define. | |
| 49 "src/svg/parser/*", # Missing SkSVG.h. | |
| 50 "src/views/animated/*", # Does not compile. | |
| 51 "src/xml/SkXMLPullParser.cpp", # Does not compile. | |
| 52 # Dependency on files outside src. | |
| 53 "src/svg/skp2svg.cpp", # Depends on tools/LazyDecodeBitmap.h. | |
| 62 # TODO(mtklein): files below here probably want upstream fixes | 54 # TODO(mtklein): files below here probably want upstream fixes |
| 63 "src/utils/SkThreadUtils_pthread_mach.cpp", # Mac-only. Move to ports? | 55 "src/utils/SkThreadUtils_pthread_mach.cpp", # Mac-only. Move to ports? |
| 64 # Non-Mac-non-Linux. Move to ports? | 56 # Non-Mac-non-Linux. Move to ports? |
| 65 "src/utils/SkThreadUtils_pthread_other.cpp", | 57 "src/utils/SkThreadUtils_pthread_other.cpp", |
| 66 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? | 58 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
| 67 "src/doc/*_XPS.cpp", # Windows-only. | 59 "src/doc/*_XPS.cpp", # Windows-only. |
| 68 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. | 60 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
| 69 ], | 61 ], |
| 70 ) | 62 ) |
| 71 | 63 |
| 64 # Platform-dependent SRCS for google3-default platform. | |
| 65 PLATFORM_SRCS = glob( | |
| 66 [ | |
| 67 "src/opts/**/*.cpp", | |
| 68 "src/opts/**/*.h", | |
| 69 "src/ports/**/*.cpp", | |
| 70 "src/ports/**/*.h", | |
| 71 "src/views/unix/**/*.c", | |
| 72 "src/views/unix/**/*.cpp", | |
| 73 "src/views/unix/**/*.h", | |
| 74 ], | |
| 75 exclude = [ | |
| 76 "src/opts/*arm*", | |
| 77 "src/opts/*mips*", | |
| 78 "src/opts/*NEON*", | |
| 79 "src/opts/*neon*", | |
| 80 "src/opts/*SSSE3*", | |
| 81 "src/opts/*ssse3*", | |
| 82 "src/opts/*SSE4*", | |
| 83 "src/opts/*sse4*", | |
| 84 "src/opts/SkBlitMask_opts_none.cpp", | |
| 85 "src/opts/SkBitmapProcState_opts_none.cpp", | |
| 86 "src/opts/SkBlitRow_opts_none.cpp", | |
| 87 "src/ports/*android*", | |
| 88 "src/ports/*chromium*", | |
| 89 "src/ports/*CG*", | |
| 90 "src/ports/*fontconfig*", | |
| 91 "src/ports/*FontConfig*", | |
| 92 "src/ports/*mac*", | |
| 93 "src/ports/*mozalloc*", | |
| 94 "src/ports/*nacl*", | |
| 95 "src/ports/*win*", | |
| 96 "src/ports/SkFontMgr_custom_embedded_factory.cpp", | |
| 97 "src/ports/SkFontMgr_empty_factory.cpp", | |
| 98 "src/ports/SkImageDecoder_WIC.cpp", | |
| 99 "src/ports/SkImageDecoder_empty.cpp", | |
| 100 "src/ports/SkImageGenerator_none.cpp", | |
| 101 "src/ports/SkTLS_none.cpp", | |
| 102 "src/views/unix/skia_unix.cpp", # Contains main. | |
| 103 ], | |
| 104 ) | |
| 105 | |
| 72 SRCS_SSSE3 = glob( | 106 SRCS_SSSE3 = glob( |
| 73 [ | 107 [ |
| 74 "src/opts/*SSSE3*.cpp", | 108 "src/opts/*SSSE3*.cpp", |
| 75 "src/opts/*ssse3*.cpp", | 109 "src/opts/*ssse3*.cpp", |
| 76 ], | 110 ], |
| 77 ) | 111 ) |
| 78 | 112 |
| 79 SRCS_SSE4 = glob( | 113 SRCS_SSE4 = glob( |
| 80 [ | 114 [ |
| 81 "src/opts/*SSE4*.cpp", | 115 "src/opts/*SSE4*.cpp", |
| 82 "src/opts/*sse4*.cpp", | 116 "src/opts/*sse4*.cpp", |
| 83 ], | 117 ], |
| 84 ) | 118 ) |
| 85 | 119 |
| 86 HDRS = glob( | 120 HDRS = glob( |
| 87 [ | 121 [ |
| 88 "include/**/*.h", | 122 "include/**/*.h", |
| 89 ], | 123 ], |
| 90 exclude = [ | 124 exclude = [ |
| 91 "include/animator/*.h", | |
| 92 "include/private/*.h", | 125 "include/private/*.h", |
| 93 ], | 126 ], |
| 94 ) | 127 ) |
| 95 | 128 |
| 96 # Includes needed by Skia implementation. Not public includes. | 129 # Includes needed by Skia implementation. Not public includes. |
| 97 INCLUDES = [ | 130 INCLUDES = [ |
| 131 "include/animator", | |
|
mtklein
2015/10/14 18:45:17
I'm a little skeptical about some of these additio
dogben
2015/10/14 23:11:05
svg is used in dm/DMSrcSink.cpp, and xml is used b
| |
| 98 "include/c", | 132 "include/c", |
| 99 "include/codec", | 133 "include/codec", |
| 100 "include/config", | 134 "include/config", |
| 101 "include/core", | 135 "include/core", |
| 102 "include/device", | 136 "include/device", |
| 103 "include/effects", | 137 "include/effects", |
| 104 "include/gpu", | 138 "include/gpu", |
| 105 "include/images", | 139 "include/images", |
| 106 "include/pathops", | 140 "include/pathops", |
| 107 "include/pdf", | 141 "include/pdf", |
| 108 "include/pipe", | 142 "include/pipe", |
| 109 "include/ports", | 143 "include/ports", |
| 110 "include/private", | 144 "include/private", |
| 145 "include/svg", | |
| 111 "include/utils", | 146 "include/utils", |
| 112 "include/views", | 147 "include/views", |
| 148 "include/views/animated", | |
| 113 "include/xml", | 149 "include/xml", |
| 150 "src/codec", | |
| 114 "src/core", | 151 "src/core", |
| 115 "src/doc", | 152 "src/doc", |
| 153 "src/effects", | |
| 154 "src/fonts", | |
| 116 "src/gpu", | 155 "src/gpu", |
| 117 "src/image", | 156 "src/image", |
| 118 "src/lazy", | 157 "src/lazy", |
| 119 "src/opts", | 158 "src/opts", |
| 159 "src/pathops", | |
| 120 "src/pdf", | 160 "src/pdf", |
| 161 "src/pipe/utils", | |
| 121 "src/ports", | 162 "src/ports", |
| 122 "src/sfnt", | 163 "src/sfnt", |
| 123 "src/utils", | 164 "src/utils", |
| 165 "src/utils/debugger", | |
| 124 "third_party/etc1", | 166 "third_party/etc1", |
| 125 "third_party/ktx", | 167 "third_party/ktx", |
| 126 ] | 168 ] |
| 127 | 169 |
| 170 DM_SRCS = glob( | |
| 171 [ | |
| 172 "dm/*.cpp", | |
| 173 "dm/*.h", | |
| 174 "gm/*.c", | |
| 175 "gm/*.cpp", | |
| 176 "gm/*.h", | |
| 177 "tests/*.cpp", | |
| 178 "tests/*.h", | |
| 179 "tools/CrashHandler.cpp", | |
| 180 "tools/CrashHandler.h", | |
| 181 "tools/LazyDecodeBitmap.cpp", | |
| 182 "tools/LazyDecodeBitmap.h", | |
| 183 "tools/ProcStats.cpp", | |
| 184 "tools/ProcStats.h", | |
| 185 "tools/Resources.cpp", | |
| 186 "tools/Resources.h", | |
| 187 "tools/SkBitmapRegionDecoderInterface.cpp", | |
| 188 "tools/SkBitmapRegionDecoderInterface.h", | |
| 189 "tools/SkBitmapRegionSampler.cpp", | |
| 190 "tools/SkBitmapRegionSampler.h", | |
| 191 "tools/SkBitmapRegionCanvas.cpp", | |
| 192 "tools/SkBitmapRegionCanvas.h", | |
| 193 "tools/flags/*.cpp", | |
| 194 "tools/flags/*.h", | |
| 195 "tools/timer/*.cpp", | |
| 196 "tools/timer/*.h", | |
| 197 "tools/sk_tool_utils.cpp", | |
| 198 "tools/sk_tool_utils_font.cpp", | |
| 199 "tools/sk_tool_utils.h", | |
| 200 ], | |
| 201 exclude = [ | |
| 202 "gm/gmmain.cpp", # Old main | |
|
mtklein
2015/10/14 18:45:16
Doesn't exist anymore.
dogben
2015/10/14 23:11:05
Done.
| |
| 203 "tests/skia_test.cpp", # Old main. | |
| 204 "tests/SkpSkGrTest.cpp", # Alternate main. | |
| 205 "tests/PathOpsSkpClipTest.cpp", # Alternate main. | |
| 206 "tests/FontConfigParser.cpp", # Android-only. | |
|
mtklein
2015/10/14 18:45:16
Ditto.
dogben
2015/10/14 23:11:05
Done.
| |
| 207 "tests/FontMgrAndroidParserTest.cpp", # Android-only. | |
| 208 "gm/techtalk1.cpp", # Not in our .gyp. | |
|
mtklein
2015/10/14 18:45:17
Ditto.
dogben
2015/10/14 23:11:05
Done.
| |
| 209 "dm/DMSrcSinkAndroid.cpp", # Does not compile | |
|
mtklein
2015/10/14 18:45:16
Might want to say "# Android-only.", but this is f
dogben
2015/10/14 23:11:05
Done.
| |
| 210 "tools/timer/SysTimer_windows.cpp", | |
| 211 "tools/timer/SysTimer_mach.cpp", | |
| 212 ], | |
| 213 ) | |
| 214 | |
| 215 DM_INCLUDES = [ | |
| 216 "experimental/PdfViewer", | |
| 217 "experimental/PdfViewer/src", | |
| 218 "gm", | |
| 219 "dm", | |
| 220 "include/config", | |
| 221 "include/core", | |
| 222 "include/effects", | |
| 223 "include/ports", | |
| 224 "src/core", | |
| 225 "src/effects", | |
| 226 "src/fonts", | |
| 227 "src/pathops", | |
| 228 "src/pdf", | |
| 229 "src/pipe/utils", | |
| 230 "src/utils/debugger", | |
| 231 "tests", | |
| 232 "tools", | |
| 233 "tools/flags", | |
| 234 "tools/timer", | |
| 235 ] | |
| 236 | |
| 128 COPTS = [ | 237 COPTS = [ |
| 129 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( | 238 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
| 130 "-Wno-implicit-fallthrough", # Some intentional fallthrough. | 239 "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 131 ] | 240 ] |
| 132 | 241 |
| 133 DEFINES = [ | 242 DEFINES = [ |
| 134 # It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. | 243 # It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. |
| 135 "SK_RELEASE", | 244 "SK_RELEASE", |
| 136 # Chrome DEFINES. | 245 # Chrome DEFINES. |
| 137 "SK_USE_FLOATBITS", | 246 "SK_USE_FLOATBITS", |
| 138 "SK_USE_FREETYPE_EMBOLDEN", | 247 "SK_USE_FREETYPE_EMBOLDEN", |
| 139 # Turn on a few Google3-specific build fixes. | 248 # Turn on a few Google3-specific build fixes. |
| 140 "GOOGLE3", | 249 "GOOGLE3", |
| 141 "SK_BUILD_FOR_UNIX", | 250 "SK_BUILD_FOR_UNIX", |
| 142 "SK_SAMPLES_FOR_X", | 251 "SK_SAMPLES_FOR_X", |
| 143 ] | 252 ] |
| 144 | 253 |
| 145 LINKOPTS = ["-ldl"] | 254 LINKOPTS = ["-ldl"] |
| 255 | |
| 256 cc_library( | |
| 257 name = "opts_ssse3", | |
| 258 srcs = SRCS_SSSE3, | |
| 259 copts = COPTS + ["-mssse3"], | |
| 260 defines = DEFINES, | |
| 261 includes = INCLUDES, | |
| 262 ) | |
| 263 | |
| 264 cc_library( | |
| 265 name = "opts_sse4", | |
| 266 srcs = SRCS_SSE4, | |
| 267 copts = COPTS + ["-msse4"], | |
| 268 defines = DEFINES, | |
| 269 includes = INCLUDES, | |
| 270 ) | |
| 271 | |
| 272 cc_library( | |
| 273 name = "skia", | |
| 274 srcs = SRCS + PLATFORM_SRCS, | |
| 275 hdrs = HDRS, | |
| 276 copts = COPTS, | |
| 277 defines = DEFINES, | |
| 278 includes = INCLUDES, | |
| 279 linkopts = LINKOPTS, | |
| 280 visibility = [":skia_clients"], | |
| 281 deps = DEPS, | |
|
mtklein
2015/10/14 18:45:17
It might be clearer if we move the parts of DEPS t
dogben
2015/10/14 23:11:05
Done.
| |
| 282 ) | |
| 283 | |
| 284 cc_test( | |
| 285 name = "dm", | |
| 286 size = "large", | |
| 287 srcs = DM_SRCS, | |
| 288 args = [ | |
| 289 "--nogpu", | |
| 290 "--verbose", | |
| 291 # TODO(mtklein): maybe investigate why these fail? | |
| 292 "--match ~FontHostStream ~FontMgr ~Gif ~Picture ~Scalar ~VarAlloc ~Canva s ~Codec_stripes ~Stream ~skps", | |
| 293 "--resourcePath %s/resources" % BASE_DIR, | |
| 294 "--images %s/resources" % BASE_DIR, | |
| 295 ], | |
| 296 copts = COPTS, | |
| 297 data = glob(["resources/*"]), | |
| 298 defines = DEFINES, | |
| 299 includes = DM_INCLUDES, | |
| 300 deps = DM_DEPS, | |
| 301 ) | |
| OLD | NEW |