diff options
author | Herb Derby <herb@google.com> | 2017-03-06 17:18:47 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-08 20:06:15 +0000 |
commit | 3139de39d7adc263555e063300f0a5e7b7a86d11 (patch) | |
tree | bc9fd40c48d384a0821e324fc657f6eb39812a9e /bench | |
parent | 7dd57b6a936af923a031f21c4ca9dc1031742473 (diff) |
Remove SkChunckAlloc
Change-Id: Ia400dd2d8aa398cf53852acd71c4a45228752496
Reviewed-on: https://skia-review.googlesource.com/9328
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'bench')
-rw-r--r-- | bench/MemoryBench.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/bench/MemoryBench.cpp b/bench/MemoryBench.cpp deleted file mode 100644 index b775793ead..0000000000 --- a/bench/MemoryBench.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2012 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 "SkChunkAlloc.h" -#include "SkPaint.h" -#include "SkRandom.h" -#include "SkString.h" - -class ChunkAllocBench : public Benchmark { - SkString fName; - size_t fMinSize; -public: - ChunkAllocBench(size_t minSize) { - fMinSize = minSize; - fName.printf("chunkalloc_" SK_SIZE_T_SPECIFIER, minSize); - } - - bool isSuitableFor(Backend backend) override { - return backend == kNonRendering_Backend; - } - -protected: - const char* onGetName() override { - return fName.c_str(); - } - - void onDraw(int loops, SkCanvas*) override { - size_t inc = fMinSize >> 4; - SkASSERT(inc > 0); - size_t total = fMinSize * 64; - - SkChunkAlloc alloc(fMinSize); - - for (int i = 0; i < loops; ++i) { - size_t size = 0; - int calls = 0; - while (size < total) { - alloc.allocThrow(inc); - size += inc; - calls += 1; - } - alloc.reset(); - } - } - -private: - typedef Benchmark INHERITED; -}; - -DEF_BENCH( return new ChunkAllocBench(64); ) -DEF_BENCH( return new ChunkAllocBench(8*1024); ) |