Bug 1252302 - Remove gfx/thebes/Makefile.in; r=gps
authorMike Shal <mshal@mozilla.com>
Fri, 26 Feb 2016 23:25:31 -0500
changeset 322977 1be1bac73a4fda04c8720571d856debad65b030f
parent 322976 fe3b0ce3a5fe3d28313ecd225cd800e45c435a3b
child 322978 6f2ba39efd9bae76a5a33abd971c132d01aeb90b
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1252302
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1252302 - Remove gfx/thebes/Makefile.in; r=gps This requires converting genTables.py into something moz.build can call into. MozReview-Commit-ID: 11kXtK8bP5W
gfx/thebes/Makefile.in
gfx/thebes/genTables.py
gfx/thebes/moz.build
deleted file mode 100644
--- a/gfx/thebes/Makefile.in
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/rules.mk
-
-DeprecatedPremultiplyTables.h: $(srcdir)/genTables.py
-	$(PYTHON) $(srcdir)/genTables.py
--- a/gfx/thebes/genTables.py
+++ b/gfx/thebes/genTables.py
@@ -1,12 +1,22 @@
 #!/usr/bin/python
 
+from __future__ import print_function
+import sys
+
 def table_generator(f):
     return ",\n".join([", ".join(["0x%2.2x" % h for h in [f(i) for i in range(r,r+16)]]) for r in range(0, 65536, 16)])
 
-with open("DeprecatedPremultiplyTables.h", "w") as f:
-  f.write("const uint8_t gfxUtils::sPremultiplyTable[256*256] = {\n");
-  f.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
-  f.write("};\n");
-  f.write("const uint8_t gfxUtils::sUnpremultiplyTable[256*256] = {\n");
-  f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
-  f.write("};\n");
+def generate(output):
+    output.write("const uint8_t gfxUtils::sPremultiplyTable[256*256] = {\n");
+    output.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
+    output.write("};\n");
+    output.write("const uint8_t gfxUtils::sUnpremultiplyTable[256*256] = {\n");
+    output.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
+    output.write("};\n");
+
+if __name__ == '__main__':
+    if len(sys.argv) != 2:
+        print("Usage: genTables.py <header.h>", file=sys.stderr)
+        sys.exit(1)
+    with open(sys.argv[1], 'w') as f:
+        generate(f)
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -266,16 +266,17 @@ if CONFIG['GNU_CXX']:
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 GENERATED_FILES = [
     'DeprecatedPremultiplyTables.h',
 ]
+GENERATED_FILES['DeprecatedPremultiplyTables.h'].script = 'genTables.py:generate'
 
 LOCAL_INCLUDES += [
     '/dom/workers',
     '/dom/xml',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
   LOCAL_INCLUDES += ['/widget/gonk']