aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-04-16 20:10:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-16 20:10:55 -0700
commitca1a22ee534f0fcabed7fa06cbf3ea5068b489da (patch)
treecf5d3ae94d686010f9582a15c518dec362d32054 /bench
parentd803cdad725b6db07b6df0ae7f390f5dbef46475 (diff)
Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/)
Reason for revert: fix (removal from gypi/gn files) has landed in chrome. Original issue's description: > Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1088383003/) > > Reason for revert: > This change is causing the DEPS roll to fail: > > > http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/78771/steps/gn/logs/stdio > > Original issue's description: > > remove unused (by clients) SkPathUtils > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/aab35d91b8b80acd1902594bbf542083fdfa4bb7 > > TBR=scroggo@google.com,reed@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/bdb0bf5f8858043878d8a4fa8130c6c87bef3fd4 TBR=scroggo@google.com,jcgregorio@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1091963002
Diffstat (limited to 'bench')
-rw-r--r--bench/PathUtilsBench.cpp72
1 files changed, 0 insertions, 72 deletions
diff --git a/bench/PathUtilsBench.cpp b/bench/PathUtilsBench.cpp
deleted file mode 100644
index 6c8086fb9d..0000000000
--- a/bench/PathUtilsBench.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2011 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 "SkPathUtils.h"
-#include "SkRandom.h"
-#include "SkString.h"
-#include "SkTime.h"
-
-#define H 16
-#define W 16
-#define STRIDE 2
-
-//this function is redefined for sample, test, and bench. is there anywhere
-// I can put it to avoid code duplcation?
-static void fillRandomBits( int chars, char* bits ){
- SkRandom rand(SkTime::GetMSecs());
-
- for (int i = 0; i < chars; ++i){
- bits[i] = rand.nextU();
- }
-}
-
-static void path_proc(char* bits, SkPath* path) {
- SkPathUtils::BitsToPath_Path(path, bits, H, W, STRIDE);
-}
-
-static void region_proc(char* bits, SkPath* path) {
- SkPathUtils::BitsToPath_Region(path, bits, H, W, STRIDE);
-}
-
-/// Emulates the mix of rects blitted by gmail during scrolling
-class PathUtilsBench : public Benchmark {
- typedef void (*Proc)(char*, SkPath*);
-
- Proc fProc;
- SkString fName;
- char* bits[H * STRIDE];
-
-public:
- PathUtilsBench(Proc proc, const char name[]) {
- fProc = proc;
- fName.printf("pathUtils_%s", name);
-
-
- }
-
-protected:
- virtual const char* onGetName() { return fName.c_str(); }
-
- virtual void onDraw(const int loops, SkCanvas* canvas) {
-
- for (int i = 0; i < loops; ++i){
- //create a random 16x16 bitmap
- fillRandomBits(H * STRIDE, (char*) &bits);
-
- //use passed function pointer to handle it
- SkPath path;
- fProc( (char*) &bits, &path);
- }
- }
-
-private:
- typedef Benchmark INHERITED;
-};
-
-DEF_BENCH( return SkNEW_ARGS(PathUtilsBench, (path_proc, "path")); )
-DEF_BENCH( return SkNEW_ARGS(PathUtilsBench, (region_proc, "region")); )