aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-01-30 11:30:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 19:24:15 +0000
commit537d9c0229b296a1b19f678432011d748d73cf18 (patch)
treefe2d3bc9b871479097148e694b2a32f614828795 /gn
parent547fe0c0189f8710f2c4c24907c41a32d370e452 (diff)
SkQP: remove skia_embed_resources option
Motivation: delete unnecessary code. ResourceFactory.h provides a much more flexible way of fixing the same problem. Change-Id: Ib8a3ce25ce98e4f752dc1e7ce88eb9ceb95a4372 Reviewed-on: https://skia-review.googlesource.com/101920 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'gn')
-rwxr-xr-xgn/generate_binary_asset.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/gn/generate_binary_asset.py b/gn/generate_binary_asset.py
deleted file mode 100755
index 671231b401..0000000000
--- a/gn/generate_binary_asset.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python2
-# 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 sys
-
-def get_resources(rdir):
- for root, _, files in os.walk(rdir):
- for filepath in files:
- fullpath = os.path.join(root, filepath)
- if os.path.isfile(fullpath):
- yield os.path.relpath(fullpath, rdir)
-
-def main(resource_dir, array_name, filename):
- with open(filename, 'w') as o:
- o.write('//generated file\n#include "BinaryAsset.h"\n\n');
- names = []
- for n in sorted(get_resources(resource_dir)):
- o.write('static const unsigned char x%d[] = {\n' % len(names))
- with open(os.path.join(resource_dir, n), 'rb') as f:
- while True:
- buf = f.read(20)
- if len(buf) == 0:
- break
- o.write(''.join('%d,' % ord(x) for x in buf) + '\n')
- o.write('};\n')
- names.append(n)
- o.write('\nBinaryAsset %s[] = {\n' % array_name)
- for i, n in enumerate(names):
- o.write(' {"%s", x%d, sizeof(x%d)},\n' % (n, i, i))
- o.write(' {nullptr, nullptr, 0}\n};\n')
-
-if __name__ == '__main__':
- if len(sys.argv) < 4:
- msg = 'usage:\n %s SOURCE_DIRECTORY ARRAY_IDENTIFIER OUTPUT_PATH.cpp\n\n'
- sys.stderr.write(msg % sys.argv[0])
- exit(1)
- main(*sys.argv[1:4])
-