Skip to content

Commit

Permalink
Fix benches that aren't really timing what we want
Browse files Browse the repository at this point in the history
Remove full clears from benches
Fix unbounded canvas modification in GM benches

Bug: skia:
Change-Id: Ie3d67282714a7b4e980aec399056c0e9df330993
Reviewed-on: https://skia-review.googlesource.com/86040
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
  • Loading branch information
brianosman authored and Skia Commit-Bot committed Dec 18, 2017
1 parent 46845d1 commit 7035a8e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions bench/BlurOccludedRRectBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class BlurOccludedRRectBench : public Benchmark {

void onDraw(int loops, SkCanvas* canvas) override {
for (int l = 0; l < loops; ++l) {
canvas->clear(0xFFFAFAFA);

SkPaint opaque;
opaque.setAntiAlias(true);
opaque.setColor(SK_ColorWHITE);
Expand Down
3 changes: 0 additions & 3 deletions bench/ChartBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ class ChartBench : public Benchmark {
}

for (int frame = 0; frame < loops; ++frame) {

canvas->clear(0xFFE0F0E0);

SkPath plotPath;
SkPath fillPath;

Expand Down
1 change: 1 addition & 0 deletions bench/GMBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void GMBench::onDraw(int loops, SkCanvas* canvas) {
// Does the GM ever rely on drawBackground to lazily compute something?
fGM->drawBackground(canvas);
for (int i = 0; i < loops; ++i) {
SkAutoCanvasRestore acr(canvas, true);
fGM->drawContent(canvas);
}
}
Expand Down

0 comments on commit 7035a8e

Please sign in to comment.