Bug 1309272, part 1 - Add an --enable-skia-pdf configuration option. r=lsalzman

--HG--
extra : rebase_source : 2edd8282c26e8772caea3db0a3d9204a4838e8db
This commit is contained in:
Jonathan Watt 2016-10-26 19:23:07 +01:00
Родитель f17619fa58
Коммит 7b894d6da6
3 изменённых файлов: 52 добавлений и 1 удалений

Просмотреть файл

@ -217,7 +217,6 @@ def generate_separated_sources(platform_sources):
'opts_check_x86',
'third_party',
# unused in skia/src/utils
'SkBitSet',
'SkBoundaryPatch',
'SkCamera',
'SkCanvasStack',
@ -289,6 +288,7 @@ def generate_separated_sources(platform_sources):
'skia/src/opts/SkOpts_neon.cpp',
},
'none': set(),
'pdf': set(),
'gpu': set()
})
@ -318,6 +318,14 @@ def generate_separated_sources(platform_sources):
separated[key].add(value)
if os.system("cd skia && GYP_GENERATORS=dump_mozbuild ./gyp_skia -D OS=linux -D host_os=linux -R pdf gyp/pdf.gyp") != 0:
print 'Failed to generate sources for Skia PDF'
else:
f = open('skia/sources.json');
separated['pdf'].add('skia/src/core/SkMD5.cpp');
separated['pdf'].update(filter(lambda x: 'pdf' in x, set(v.replace('../', 'skia/') for v in json.load(f))));
f.close()
return separated
def uniq(seq):
@ -373,6 +381,7 @@ unified_blacklist = [
'SkBlitter_Sprite.cpp',
'SkScan_Antihair.cpp',
'SkParse.cpp',
'SkPDFFont.cpp',
'SkPictureData.cpp',
'GrDrawContext',
'GrResourceCache',
@ -440,6 +449,9 @@ def write_mozbuild(sources):
write_sources(f, sources['common'], 0)
write_cflags(f, sources['common'], opt_whitelist, 'skia_opt_flags', 0)
f.write("if CONFIG['MOZ_ENABLE_SKIA_PDF']:\n")
write_sources(f, sources['pdf'], 4)
f.write("if CONFIG['MOZ_ENABLE_SKIA_GPU']:\n")
write_sources(f, sources['gpu'], 4)

Просмотреть файл

@ -307,6 +307,30 @@ SOURCES['skia/src/core/SkOpts.cpp'].flags += skia_opt_flags
SOURCES['skia/src/core/SkSpriteBlitter4f.cpp'].flags += skia_opt_flags
SOURCES['skia/src/core/SkSpriteBlitter_ARGB32.cpp'].flags += skia_opt_flags
SOURCES['skia/src/core/SkSpriteBlitter_RGB16.cpp'].flags += skia_opt_flags
if CONFIG['MOZ_ENABLE_SKIA_PDF']:
UNIFIED_SOURCES += [
'skia/src/core/SkMD5.cpp',
'skia/src/pdf/SkDeflate.cpp',
'skia/src/pdf/SkJpegInfo.cpp',
'skia/src/pdf/SkPDFBitmap.cpp',
'skia/src/pdf/SkPDFCanon.cpp',
'skia/src/pdf/SkPDFCanvas.cpp',
'skia/src/pdf/SkPDFConvertType1FontStream.cpp',
'skia/src/pdf/SkPDFDevice.cpp',
'skia/src/pdf/SkPDFDocument.cpp',
'skia/src/pdf/SkPDFFormXObject.cpp',
'skia/src/pdf/SkPDFGraphicState.cpp',
'skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.cpp',
'skia/src/pdf/SkPDFMakeToUnicodeCmap.cpp',
'skia/src/pdf/SkPDFMetadata.cpp',
'skia/src/pdf/SkPDFResourceDict.cpp',
'skia/src/pdf/SkPDFShader.cpp',
'skia/src/pdf/SkPDFTypes.cpp',
'skia/src/pdf/SkPDFUtils.cpp',
]
SOURCES += [
'skia/src/pdf/SkPDFFont.cpp',
]
if CONFIG['MOZ_ENABLE_SKIA_GPU']:
UNIFIED_SOURCES += [
'skia/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp',

Просмотреть файл

@ -790,6 +790,21 @@ def skia_gpu(value, skia, target):
set_config('MOZ_ENABLE_SKIA_GPU', skia_gpu)
set_define('USE_SKIA_GPU', skia_gpu)
option('--enable-skia-pdf', help='Enable Skia PDF')
@depends('--enable-skia-pdf', skia, target)
def skia_pdf(value, skia, target):
if value.origin == 'default':
if not skia:
return None
elif value and not skia:
die('Cannot enable Skia PDF without enabling Skia')
if skia and value:
return True
set_config('MOZ_ENABLE_SKIA_PDF', skia_pdf)
set_define('MOZ_ENABLE_SKIA_PDF', skia_pdf)
@depends(skia, skia_gpu)
def skia_includes(skia, skia_gpu):
includes = []