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

Unified Diff: bench/SkBenchLogger.h

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 years, 6 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 | « bench/ShaderMaskBench.cpp ('k') | bench/SkBenchLogger.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SkBenchLogger.h
diff --git a/bench/SkBenchLogger.h b/bench/SkBenchLogger.h
deleted file mode 100644
index 77a08373bf686e327e2f7c561110c17fdadf79a1..0000000000000000000000000000000000000000
--- a/bench/SkBenchLogger.h
+++ /dev/null
@@ -1,77 +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.
- */
-
-#ifndef SkBenchLogger_DEFINED
-#define SkBenchLogger_DEFINED
-
-#include "SkTypes.h"
-#include "SkString.h"
-#include <stdio.h>
-
-class SkFILEWStream;
-
-/**
- * Class that allows logging to a file while simultaneously logging to stdout/stderr.
- */
-class SkBenchLogger {
-public:
- SkBenchLogger();
-
- /**
- * Not virtual, since this class is not intended to be subclassed.
- */
- ~SkBenchLogger();
-
- /**
- * Specify a file to write progress logs to. Unless this is called with a valid file path,
- * SkBenchLogger will only write to stdout/stderr.
- */
- bool SetLogFile(const char file[]);
-
- /**
- * Log an error to stderr, taking a C style string as input.
- */
- void logError(const char msg[]) { this->nativeLogError(msg); }
-
- /**
- * Log an error to stderr, taking an SkString as input.
- */
- void logError(const SkString& str) { this->nativeLogError(str.c_str()); }
-
- /**
- * Log the progress of the bench tool to both stdout and the log file specified by SetLogFile,
- * if any, taking a C style string as input.
- */
- void logProgress(const char msg[]) {
- this->nativeLogProgress(msg);
- this->fileWrite(msg, strlen(msg));
- }
-
- /**
- * Log the progress of the bench tool to both stdout and the log file specified by SetLogFile,
- * if any, taking an SkString as input.
- */
- void logProgress(const SkString& str) {
- this->nativeLogProgress(str.c_str());
- this->fileWrite(str.c_str(), str.size());
- }
-
-private:
-#ifdef SK_BUILD_FOR_ANDROID
- void nativeLogError(const char msg[]) { SkDebugf("%s", msg); }
-#else
- void nativeLogError(const char msg[]) { fprintf(stderr, "%s", msg); }
-#endif
- void nativeLogProgress(const char msg[]) { SkDebugf("%s", msg); }
-
- void fileWrite(const char msg[], size_t size);
-
- SkFILEWStream* fFileStream;
-};
-
-#endif // SkBenchLogger_DEFINED
« no previous file with comments | « bench/ShaderMaskBench.cpp ('k') | bench/SkBenchLogger.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698