Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: tools/VisualBench/VisualDebugModule.cpp

Issue 2018603003: Remove VisualBench and its Android implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/VisualBench/VisualDebugModule.h ('k') | tools/VisualBench/VisualFlags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualDebugModule.cpp
diff --git a/tools/VisualBench/VisualDebugModule.cpp b/tools/VisualBench/VisualDebugModule.cpp
deleted file mode 100644
index e4e70ddacf86b4fdd4c6ff978e3799cfed693c50..0000000000000000000000000000000000000000
--- a/tools/VisualBench/VisualDebugModule.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "VisualDebugModule.h"
-
-#include "SkCanvas.h"
-
-VisualDebugModule::VisualDebugModule(VisualBench* owner)
- : fState(kInit_State)
- , fIndex(0)
- , fOwner(owner) {
- // VisualDebugModule only really makes sense for SKPs
- fBenchmarkStream.reset(new VisualBenchmarkStream(owner->getSurfaceProps(), true));
-}
-
-bool VisualDebugModule::advanceIfNecessary(SkCanvas* canvas) {
- Benchmark* benchmark = fBenchmarkStream->current();
- switch (fState) {
- case kInit_State: {
- // setup new benchmark
- benchmark->delayedSetup();
- fOwner->clear(canvas, SK_ColorWHITE, 3);
- benchmark->preTimingHooks(canvas);
-
- // reset debug canvas
- SkIPoint size = benchmark->getSize();
- fDebugCanvas.reset(new SkDebugCanvas(size.fX, size.fY));
-
- // pour benchmark into canvas
- benchmark->draw(1, fDebugCanvas);
- fIndex = fDebugCanvas->getSize() - 1;
- fState = kPlay_State;
- break;
- }
- case kPlay_State: break;
- case kNext_State:
- // cleanup after the last SKP
- benchmark->postTimingHooks(canvas);
- fOwner->reset();
- if (!fBenchmarkStream->next()) {
- SkDebugf("Exiting VisualBench successfully\n");
- fOwner->closeWindow();
- return false;
- }
- fState = kInit_State;
- break;
- }
- return true;
-}
-
-void VisualDebugModule::draw(SkCanvas* canvas) {
- if (!fBenchmarkStream->current() || !this->advanceIfNecessary(canvas)) {
- return;
- }
-
- fDebugCanvas->drawTo(canvas, fIndex);
- canvas->flush();
- fOwner->present();
-}
-
-bool VisualDebugModule::onHandleChar(SkUnichar c) {
- switch (c) {
- case ' ': fState = kNext_State; break;
- case 'a': fIndex = (fIndex + 1) % (fDebugCanvas->getSize() - 1); break;
- case 's': fIndex = fIndex <= 0 ? fDebugCanvas->getSize() - 1 : fIndex - 1; break;
- default: break;
- }
-
- return true;
-}
« no previous file with comments | « tools/VisualBench/VisualDebugModule.h ('k') | tools/VisualBench/VisualFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698