aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/QuickRejectBench.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2016-08-12 02:22:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-12 02:22:33 -0700
commit5aeb2fa25384b9d3202a1e8c6cd6832038419fe6 (patch)
treec60a7144ccde408e38e4555f2d112699d99bdcc1 /bench/QuickRejectBench.cpp
parentcf736d7b66d76917c3384c0ad2f4cdc6d52db2a1 (diff)
Revert of Optimized implementation of quickReject() (patchset #12 id:260001 of https://codereview.chromium.org/2225393002/ )
Reason for revert: New assert triggering in the Chrome roll, https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/208750/steps/webkit_unit_tests%20%28with%20patch%29%20on%20Ubuntu-12.04/logs/FrameThrottlingTest.SynchronousLayoutInAnimationFrameCallback and breaks the SKNX_NO_SIMD bot, https://codereview.chromium.org/2236363004 Original issue's description: > Optimized implementation of quickReject() > > Impl Overview > (1) Keep the device clip bounds up to date. This > requires minimal additional work in a few places > throughout canvas. > (2) Keep track of if the ctm isScaleTranslate. Yes, > there's a function that does this, but it's slow > to call. > (3) Perform the src->device transform in quick reject, > then check intersection/nan. > > Other Notes: > (1) NaN and intersection checks are performed > simultaneously. > (2) We no longer quick reject infinity. > (3) Affine and perspective are both handled in the slow > case. > (4) SkRasterClip::isEmpty() is handled by the intersection > check. > > Performance on Nexus 6P: > 93.2ms -> 59.8ms > > Overall Android Jank Tests Performance Impact: > Should gain us a ms or two on some tests. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002 > > Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da TBR=reed@google.com,herb@google.com,msarett@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2231393003
Diffstat (limited to 'bench/QuickRejectBench.cpp')
-rw-r--r--bench/QuickRejectBench.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/bench/QuickRejectBench.cpp b/bench/QuickRejectBench.cpp
deleted file mode 100644
index 1feade41f5..0000000000
--- a/bench/QuickRejectBench.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "Benchmark.h"
-#include "SkCanvas.h"
-#include "SkRandom.h"
-
-class QuickRejectBench : public Benchmark {
- enum { N = 1000000 };
- float fFloats[N];
- int fInts [N];
-
- const char* onGetName() override { return "quick_reject"; }
- bool isSuitableFor(Backend backend) override { return backend != kNonRendering_Backend; }
-
- void onDelayedSetup() override {
- SkRandom rand;
- for (int i = 0; i < N; ++i) {
- fFloats[i] = 300.0f * (rand.nextSScalar1() + 0.5f);
- }
- }
-
- void onDraw(int loops, SkCanvas* canvas) override {
- while (loops --> 0) {
- for (int i = 0; i < N - 4; i++) {
- if (canvas->quickReject(*(SkRect*)(fFloats+i))) {
- fInts[i] = 11;
- } else {
- fInts[i] = 24;
- }
- }
- }
- }
-};
-DEF_BENCH( return new QuickRejectBench; )
-
-class ConcatBench : public Benchmark {
- SkMatrix fMatrix;
-
- const char* onGetName() override { return "concat"; }
- bool isSuitableFor(Backend backend) override { return backend != kNonRendering_Backend; }
-
- void onDelayedSetup() override {
- SkRandom r;
- fMatrix.setScale(5.0f, 5.0f);
- fMatrix.setTranslateX(10.0f);
- fMatrix.setTranslateY(10.0f);
- }
-
- void onDraw(int loops, SkCanvas* canvas) override {
- while (loops --> 0) {
- canvas->setMatrix(SkMatrix::MakeScale(3.0f));
- canvas->concat(fMatrix);
- }
- }
-};
-DEF_BENCH( return new ConcatBench; )