aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-10-13 12:35:50 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-13 22:31:12 +0000
commit7a0ebfc033463907e2088401972d14ea8589cdb5 (patch)
tree5ac7d35893034bfa73169c60ecc001b682690519
parent5b6e6277ad8768e37199b677eea361ca51654477 (diff)
Add a tooling flag for path mask caching
Adds the flag and a disables caching on the CCPR bots. Bug: skia: Change-Id: Icb85e77f89634dda1d419dacac5b8a93340723f0 Reviewed-on: https://skia-review.googlesource.com/59740 Reviewed-by: Eric Boren <borenet@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
-rw-r--r--bench/nanobench.cpp1
-rw-r--r--dm/DM.cpp1
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR.json2
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR.json2
-rw-r--r--infra/bots/recipes/test.py2
-rw-r--r--samplecode/SampleApp.cpp1
-rw-r--r--tools/flags/SkCommonFlags.cpp4
-rw-r--r--tools/flags/SkCommonFlags.h3
-rw-r--r--tools/skpbench/skpbench.cpp2
-rw-r--r--tools/viewer/Viewer.cpp10
10 files changed, 21 insertions, 7 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 203ed67073..c5dfe0cf7f 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1140,6 +1140,7 @@ int main(int argc, char** argv) {
#if SK_SUPPORT_GPU
grContextOpts.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
+ grContextOpts.fAllowPathMaskCaching = FLAGS_cachePathMasks;
grContextOpts.fExecutor = GpuExecutorForTools();
#endif
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 6b76a92a1e..00bcf6ab33 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1341,6 +1341,7 @@ int main(int argc, char** argv) {
GrContextOptions grCtxOptions;
#if SK_SUPPORT_GPU
grCtxOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
+ grCtxOptions.fAllowPathMaskCaching = FLAGS_cachePathMasks;
grCtxOptions.fExecutor = GpuExecutorForTools();
#endif
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR.json b/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR.json
index be3fd3ddd2..2bf8b77ba9 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR.json
@@ -678,7 +678,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
- "set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value TegraX1 extra_config Android_CCPR model NVIDIA_Shield os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --pr ccpr --config gl --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --verbose; echo $? >/data/local/tmp/rc",
+ "set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-Android_CCPR swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value TegraX1 extra_config Android_CCPR model NVIDIA_Shield os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --pr ccpr --cachePathMasks false --config gl --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR.json b/infra/bots/recipes/test.expected/Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR.json
index bc34ba3ea2..07985cb018 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR.json
@@ -678,7 +678,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
- "set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Adreno530 extra_config Android_CCPR model PixelXL os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --pr ccpr --config gles --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --verbose; echo $? >/data/local/tmp/rc",
+ "set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-PixelXL-GPU-Adreno530-arm64-Debug-Android_CCPR swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Adreno530 extra_config Android_CCPR model PixelXL os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --pr ccpr --cachePathMasks false --config gles --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {
diff --git a/infra/bots/recipes/test.py b/infra/bots/recipes/test.py
index aedc35dde5..a0020bf32c 100644
--- a/infra/bots/recipes/test.py
+++ b/infra/bots/recipes/test.py
@@ -227,7 +227,7 @@ def dm_flags(api, bot):
# Test coverage counting path renderer.
if 'CCPR' in bot:
configs = [c for c in configs if c == 'gl' or c == 'gles']
- args.extend(['--pr', 'ccpr'])
+ args.extend(['--pr', 'ccpr', '--cachePathMasks', 'false'])
args.append('--config')
args.extend(configs)
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index fef6f97b16..6a5d1fedb6 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -858,6 +858,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
#if SK_SUPPORT_GPU
fBackendOptions.fGrContextOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
+ fBackendOptions.fGrContextOptions.fAllowPathMaskCaching = FLAGS_cachePathMasks;
fBackendOptions.fMSAASampleCount = FLAGS_msaa;
fBackendOptions.fDeepColor = FLAGS_deepColor;
#endif
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index 0fc1e1d186..bebb88b088 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -87,6 +87,10 @@ DEFINE_bool(deltaAA, kDefaultDeltaAA,
DEFINE_bool(forceDeltaAA, false, "Force delta anti-aliasing for all paths.");
+#if SK_SUPPORT_GPU
+DEFINE_bool(cachePathMasks, true, "Allows path mask textures to be cached in GPU configs.");
+#endif
+
bool CollectImages(SkCommandLineFlags::StringArray images, SkTArray<SkString>* output) {
SkASSERT(output);
diff --git a/tools/flags/SkCommonFlags.h b/tools/flags/SkCommonFlags.h
index 3d4b33e640..4f93d1974f 100644
--- a/tools/flags/SkCommonFlags.h
+++ b/tools/flags/SkCommonFlags.h
@@ -36,6 +36,9 @@ DECLARE_bool(analyticAA);
DECLARE_bool(forceAnalyticAA);
DECLARE_bool(deltaAA);
DECLARE_bool(forceDeltaAA);
+#if SK_SUPPORT_GPU
+DECLARE_bool(cachePathMasks);
+#endif
DECLARE_string(key);
DECLARE_string(properties);
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index c0ead46155..ef7a5bbabf 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -10,6 +10,7 @@
#include "SkGr.h"
#include "SkCanvas.h"
+#include "SkCommonFlags.h"
#include "SkCommonFlagsPathRenderer.h"
#include "SkOSFile.h"
#include "SkOSPath.h"
@@ -277,6 +278,7 @@ int main(int argc, char** argv) {
// Create a context.
GrContextOptions ctxOptions;
ctxOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
+ ctxOptions.fAllowPathMaskCaching = FLAGS_cachePathMasks;
sk_gpu_test::GrContextFactory factory(ctxOptions);
sk_gpu_test::ContextInfo ctxInfo =
factory.getContextInfo(config->getContextType(), config->getContextOverrides());
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index e1f72d7575..85b78baf8f 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -140,8 +140,8 @@ static DEFINE_string2(match, m, nullptr,
"If a bench does not match any list entry,\n"
"it is skipped unless some list entry starts with ~");
-DEFINE_string(slide, "", "Start on this sample.");
-DEFINE_bool(list, false, "List samples?");
+static DEFINE_string(slide, "", "Start on this sample.");
+static DEFINE_bool(list, false, "List samples?");
#ifdef SK_VULKAN
# define BACKENDS_STR "\"sw\", \"gl\", and \"vk\""
@@ -159,10 +159,11 @@ static DEFINE_string(jpgs, "jpgs", "Directory to read jpgs from.");
static DEFINE_string2(backend, b, "sw", "Backend to use. Allowed values are " BACKENDS_STR ".");
-DEFINE_int32(msaa, 0, "Number of subpixel samples. 0 for no HW antialiasing.");
+static DEFINE_int32(msaa, 0, "Number of subpixel samples. 0 for no HW antialiasing.");
+static DEFINE_bool(cachePathMasks, true, "Allows path mask textures to be cached in GPU configs.");
DEFINE_pathrenderer_flag;
-DEFINE_bool(instancedRendering, false, "Enable instanced rendering on GPU backends.");
+static DEFINE_bool(instancedRendering, false, "Enable instanced rendering on GPU backends.");
DECLARE_int32(threads)
const char* kBackendTypeStrings[sk_app::Window::kBackendTypeCount] = {
@@ -304,6 +305,7 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
displayParams.fMSAASampleCount = FLAGS_msaa;
displayParams.fGrContextOptions.fEnableInstancedRendering = FLAGS_instancedRendering;
displayParams.fGrContextOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
+ displayParams.fGrContextOptions.fAllowPathMaskCaching = FLAGS_cachePathMasks;
displayParams.fGrContextOptions.fExecutor = GpuExecutorForTools();
fWindow->setRequestedDisplayParams(displayParams);