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

Unified Diff: tools/VisualBench/VisualStreamTimingModule.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/VisualStreamTimingModule.h ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualStreamTimingModule.cpp
diff --git a/tools/VisualBench/VisualStreamTimingModule.cpp b/tools/VisualBench/VisualStreamTimingModule.cpp
deleted file mode 100644
index b5726219dd13a430e5e82f560de387f738bd71f3..0000000000000000000000000000000000000000
--- a/tools/VisualBench/VisualStreamTimingModule.cpp
+++ /dev/null
@@ -1,79 +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 "VisualStreamTimingModule.h"
-
-#include "SkCanvas.h"
-
-DEFINE_bool(reset, true, "Reset the GL context between samples.");
-
-VisualStreamTimingModule::VisualStreamTimingModule(VisualBench* owner)
- : fInitState(kReset_InitState)
- , fOwner(owner) {
- fBenchmarkStream.reset(new VisualBenchmarkStream(owner->getSurfaceProps()));
-}
-
-inline void VisualStreamTimingModule::handleInitState(SkCanvas* canvas) {
- switch (fInitState) {
- case kNewBenchmark_InitState:
- fBenchmarkStream->current()->delayedSetup();
- // fallthrough
- case kReset_InitState:
- // This will flicker unfortunately, but as we are reseting the GLTestContext each bench,
- // we unfortunately don't have a choice
- fOwner->clear(canvas, SK_ColorWHITE, 3);
- fBenchmarkStream->current()->preTimingHooks(canvas);
- break;
- case kNone_InitState:
- break;
- }
- fInitState = kNone_InitState;
-}
-
-inline void VisualStreamTimingModule::handleTimingEvent(SkCanvas* canvas,
- TimingStateMachine::ParentEvents event) {
- switch (event) {
- case TimingStateMachine::kTiming_ParentEvents:
- break;
- case TimingStateMachine::kTimingFinished_ParentEvents:
- if (this->timingFinished(fBenchmarkStream->current(), fTSM.loops(),
- fTSM.lastMeasurement())) {
- fBenchmarkStream->current()->postTimingHooks(canvas);
- fOwner->reset();
- fTSM.nextBenchmark();
- if (!fBenchmarkStream->next()) {
- SkDebugf("Exiting VisualBench successfully\n");
- fOwner->closeWindow();
- } else {
- fInitState = kNewBenchmark_InitState;
- }
- break;
- }
- // fallthrough
- case TimingStateMachine::kReset_ParentEvents:
- if (FLAGS_reset) {
- fBenchmarkStream->current()->postTimingHooks(canvas);
- fOwner->reset();
- fInitState = kReset_InitState;
- }
- break;
- }
-}
-
-void VisualStreamTimingModule::draw(SkCanvas* canvas) {
- if (!fBenchmarkStream->current()) {
- // this should never happen but just to be safe
- // TODO research why this does happen on mac
- return;
- }
-
- this->handleInitState(canvas);
- this->renderFrame(canvas, fBenchmarkStream->current(), fTSM.loops());
- fOwner->present();
- TimingStateMachine::ParentEvents event = fTSM.nextFrame(FLAGS_reset);
- this->handleTimingEvent(canvas, event);
-}
« no previous file with comments | « tools/VisualBench/VisualStreamTimingModule.h ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698