aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skqp
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 /tools/skqp
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 'tools/skqp')
-rw-r--r--tools/skqp/README.md3
-rwxr-xr-xtools/skqp/generate_gn_args1
-rwxr-xr-xtools/skqp/setup_resources11
-rw-r--r--tools/skqp/skqp.cpp2
4 files changed, 4 insertions, 13 deletions
diff --git a/tools/skqp/README.md b/tools/skqp/README.md
index bf41b25b08..cd3f0cdf3d 100644
--- a/tools/skqp/README.md
+++ b/tools/skqp/README.md
@@ -35,10 +35,10 @@ How to run the SkQP tests
test another architecture, replace `arm` with `x86`, `x64`, or `arm64`.)
python tools/skqp/download_model
+ python tools/skqp/setup_resources
python tools/git-sync-deps
python tools/skqp/generate_gn_args out/skqp-arm "$ANDROID_NDK" arm
bin/gn gen out/skqp-arm
- python tools/skqp/setup_resources . out/skqp-arm
6. Build, install, and run.
@@ -69,7 +69,6 @@ Run as a non-APK executable
2. Build the SkQP program, load files on the device, and run skqp:
- rm -f out/skqp-arm/gen/binary_resources.cpp
ninja -C out/skqp-arm skqp
python tools/skqp/run_skqp_exe out/skqp-arm
diff --git a/tools/skqp/generate_gn_args b/tools/skqp/generate_gn_args
index 7031414d59..21009a0c1d 100755
--- a/tools/skqp/generate_gn_args
+++ b/tools/skqp/generate_gn_args
@@ -12,7 +12,6 @@ target_cpu = "{arch}"
is_debug = false
ndk = "{ndk}"
ndk_api = 26
-skia_embed_resources = true
skia_enable_fontmgr_empty = true
skia_enable_pdf = false
skia_use_dng_sdk = false
diff --git a/tools/skqp/setup_resources b/tools/skqp/setup_resources
index 45b9b70e09..22f27a85dd 100755
--- a/tools/skqp/setup_resources
+++ b/tools/skqp/setup_resources
@@ -9,16 +9,7 @@ import shutil
import sys
if __name__ == '__main__':
- if len(sys.argv) != 3 or not os.path.isdir(sys.argv[1]) or not os.path.isdir(sys.argv[2]):
- sys.stderr.write('Usage\n %s SKIA_DIR BUILD_DIR\n\n' % sys.argv[0])
- sys.exit(1)
- skia = sys.argv[1]
- gen = os.path.join(sys.argv[2], 'gen')
- if not os.path.isdir(gen):
- os.mkdir(gen)
- with open(os.path.join(gen, 'binary_resources.cpp'), 'w') as o:
- o.write('#include "BinaryAsset.h"\n'
- 'BinaryAsset gResources[] = { {nullptr, nullptr, 0} };\n')
+ skia = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
dst = os.path.join(skia, 'platform_tools', 'android', 'apps', 'skqp',
'src', 'main', 'assets', 'resources')
if os.path.isdir(dst) and not os.path.islink(dst):
diff --git a/tools/skqp/skqp.cpp b/tools/skqp/skqp.cpp
index b3824a817a..cba52de6be 100644
--- a/tools/skqp/skqp.cpp
+++ b/tools/skqp/skqp.cpp
@@ -21,6 +21,7 @@
#pragma clang diagnostic pop
#endif
+#include "Resources.h"
#include "SkStream.h"
#include "SkString.h"
@@ -134,6 +135,7 @@ int main(int argc, char** argv) {
<< " [GTEST_ARGUMENTS] GMKB_DIRECTORY_PATH GMKB_REPORT_PATH\n\n";
return 1;
}
+ SetResourcePath((std::string(argv[1]) + "/resources").c_str());
gAssetMgr.reset(new StdAssetManager(argv[1]));
if (argc > 2) {
gReportDirectoryPath = argv[2];