skia2/gn/create_sksl_fp.py
Ethan Nicholas c18bb51735 SkSL include files are now stored in a binary format
This speeds up compiler construction, because we no longer have to parse
and process a bunch of SkSL source code during startup.

Change-Id: I6d6bd9b5ce78b1661be691708ab84bf399c6df8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305717
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-07-31 13:48:25 +00:00

23 lines
647 B
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
def copy(src, dst):
for line in src.readlines():
if not line.startswith("#"):
dst.write(line)
src.close()
dst = open(sys.argv[3], 'wb')
dst.write("// *********************************************************\n")
dst.write("// *** AUTOGENERATED BY create_sksl_fp.py, DO NOT EDIT ***\n")
dst.write("// *********************************************************\n\n\n")
copy(open(sys.argv[1], 'r'), dst)
copy(open(sys.argv[2], 'r'), dst)
dst.close()