skia2/bench/BenchLogger.cpp
tfarina f168b86d7f Remove Sk prefix from some bench classes.
This idea came while commenting on
https://codereview.chromium.org/343583005/

Since SkBenchmark, SkBenchLogger and SkGMBench are not part of the Skia library,
they should not have the Sk prefix.

BUG=None
TEST=make all
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/347823004
2014-06-19 12:32:29 -07:00

31 lines
635 B
C++

/*
* 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 "BenchLogger.h"
#include "SkStream.h"
BenchLogger::BenchLogger()
: fFileStream(NULL) {}
BenchLogger::~BenchLogger() {
if (fFileStream) {
SkDELETE(fFileStream);
}
}
bool BenchLogger::SetLogFile(const char *file) {
fFileStream = SkNEW_ARGS(SkFILEWStream, (file));
return fFileStream->isValid();
}
void BenchLogger::fileWrite(const char msg[], size_t size) {
if (fFileStream && fFileStream->isValid()) {
fFileStream->write(msg, size);
}
}