aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpbench
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-06-24 13:08:57 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-25 01:47:14 +0000
commita2b5b6467f347962e0d6942da0dff9148fbb3375 (patch)
treebca84406c7de1810fa2ce099fbf118e44df8c1e9 /tools/skpbench
parentebf160f308b698c075c9c1cf8d65d40cb2486238 (diff)
ccpr: Enable ccpr by default
Now that the path cache is implemented, we can use ccpr everywhere. Modifies ccpr to not cache unless the "fAllowPathMaskCaching" context option is enabled. Adds a small condition to skip complicated paths with more vertices than pixels, simply so we don't regress a couple testcases. Updates skpbench to do three draws before starting the timer, in order to prime the cache. Bug: skia: Change-Id: Ic3a0a2bdad8a22ff6431e77fa4da2b54d6bb9aba Reviewed-on: https://skia-review.googlesource.com/137207 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/skpbench')
-rw-r--r--tools/skpbench/skpbench.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index 25acb1c9f1..399bf6cdb2 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -68,6 +68,8 @@ static const char* header =
static const char* resultFormat =
"%8.4g %8.4g %8.4g %8.4g %6.3g%% %7li %9i %-5s %-6s %-9s %s";
+static constexpr int kNumFlushesToPrimeCache = 3;
+
struct Sample {
using duration = std::chrono::nanoseconds;
@@ -190,11 +192,14 @@ static void run_benchmark(const sk_gpu_test::FenceSync* fenceSync, SkCanvas* can
const Sample::duration sampleDuration = std::chrono::milliseconds(FLAGS_sampleMs);
const clock::duration benchDuration = std::chrono::milliseconds(FLAGS_duration);
- draw_skp_and_flush(canvas, skp); // draw1
+ draw_skp_and_flush(canvas, skp); // draw 1
GpuSync gpuSync(fenceSync);
- draw_skp_and_flush(canvas, skp); // draw2
- gpuSync.syncToPreviousFrame(); // waits for draw1 to finish (after draw2's cpu work is done).
+ for (int i = 1; i < kNumFlushesToPrimeCache; ++i) {
+ draw_skp_and_flush(canvas, skp); // draw N
+ // Waits for draw N-1 to finish (after draw N's cpu work is done).
+ gpuSync.syncToPreviousFrame();
+ }
clock::time_point now = clock::now();
const clock::time_point endTime = now + benchDuration;
@@ -231,10 +236,13 @@ static void run_gpu_time_benchmark(sk_gpu_test::GpuTimer* gpuTimer,
draw_skp_and_flush(canvas, skp);
GpuSync gpuSync(fenceSync);
- gpuTimer->queueStart();
- draw_skp_and_flush(canvas, skp);
- PlatformTimerQuery previousTime = gpuTimer->queueStop();
- gpuSync.syncToPreviousFrame();
+ PlatformTimerQuery previousTime = 0;
+ for (int i = 1; i < kNumFlushesToPrimeCache; ++i) {
+ gpuTimer->queueStart();
+ draw_skp_and_flush(canvas, skp);
+ previousTime = gpuTimer->queueStop();
+ gpuSync.syncToPreviousFrame();
+ }
clock::time_point now = clock::now();
const clock::time_point endTime = now + benchDuration;