skia2/gn/create_sksl_enums.py
Ethan Nicholas 7970765f7d Switched SkSL from using raw strings back to STRINGIFY
Stringify was stripping the comments from the strings, whereas raw
strings preserve them, which led to an increase in executable
size. The only effect of this change is to strip the comments back
out.

Bug: 784880
Change-Id: Icf2f9cf522cb890179f2e481a3504e8171732705
Reviewed-on: https://skia-review.googlesource.com/72524
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-16 17:52:42 +00:00

21 lines
407 B
Python

#!/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 os
import subprocess
import sys
src = open(sys.argv[1], 'r')
dst = open(sys.argv[2], 'w')
dst.write('STRINGIFY(')
for line in src.readlines():
if not line.startswith("#"):
dst.write(line)
dst.write(')\n')
src.close()
dst.close()