Bug 1136958 - Remove duplicate SkDiscardableMemory_none.cpp from gfx/skia/moz.build. r=gps

And to do so, cleanup gfx/skia/generate_mozbuild.py a little.
This commit is contained in:
Mike Hommey 2015-02-26 14:14:02 +09:00
parent 0bb7465334
commit 2e068527f5
2 changed files with 20 additions and 34 deletions

View File

@ -3,6 +3,7 @@
import os
import locale
from collections import defaultdict
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
header = """
@ -192,7 +193,7 @@ def generate_platform_sources():
f = open('trunk/sources.json');
sources[plat] = set(json.load(f));
sources[plat] = set(v.replace('../', 'trunk/') for v in json.load(f));
f.close()
return dict(sources.items() + generate_opt_sources().items())
@ -237,7 +238,7 @@ def generate_separated_sources(platform_sources):
return False
separated = {
separated = defaultdict(set, {
'common': {
#'trunk/src/effects/gradients/SkGradientTileProc.cpp',
'trunk/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
@ -282,45 +283,31 @@ def generate_separated_sources(platform_sources):
'none': {
'trunk/src/opts/SkUtils_opts_none.cpp',
}
}
})
for plat in platform_sources.keys():
if not separated.has_key(plat):
separated[plat] = set()
for value in platform_sources[plat]:
if isblacklisted(value):
continue
if value.find('_SSE') > 0 or value.find('_SSSE') > 0 or value.find('_SSE4') > 0 : #lol
separated['intel'].add(value)
if value in separated['common']:
continue
if value.find('_neon') > 0:
separated['neon'].add(value)
continue
key = plat
if value.find('_arm') > 0:
separated['arm'].add(value)
continue
if '_SSE' in value or '_SSSE' in value:
key = 'intel'
elif '_neon' in value:
key = 'neon'
elif '_arm' in value:
key = 'arm'
elif '_none' in value:
key = 'none'
elif all(value in platform_sources.get(p, {})
for p in platforms if p != plat):
key = 'common'
if value.find('_none') > 0:
separated['none'].add(value)
continue
found = True
for other in platforms:
if other == plat or not platform_sources.has_key(other):
continue
if not value in platform_sources[other]:
found = False
break;
if found:
separated['common'].add(value)
else:
separated[plat].add(value)
separated[key].add(value)
return separated
@ -334,7 +321,7 @@ def write_cflags(f, values, subsearch, cflag, indent):
for _ in range(indent):
f.write(' ')
val_list = uniq(sorted(map(lambda val: val.replace('../', 'trunk/'), values), key=lambda x: x.lower()))
val_list = uniq(sorted(values, key=lambda x: x.lower()))
if len(val_list) == 0:
return
@ -396,7 +383,7 @@ def write_list(f, name, values, indent):
for _ in range(indent):
f.write(' ')
val_list = uniq(sorted(map(lambda val: val.replace('../', 'trunk/'), values), key=lambda x: x.lower()))
val_list = uniq(sorted(values, key=lambda x: x.lower()))
if len(val_list) == 0:
return

View File

@ -852,7 +852,6 @@ else:
'trunk/src/opts/SkTextureCompression_opts_none.cpp',
'trunk/src/opts/SkUtils_opts_none.cpp',
'trunk/src/opts/SkXfermode_opts_none.cpp',
'trunk/src/ports/SkDiscardableMemory_none.cpp',
]