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

Unified Diff: tools/timer/GpuTimer.cpp

Issue 344213003: Move BenchTimer to tools as Timer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: alpha 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
Index: tools/timer/GpuTimer.cpp
diff --git a/bench/BenchGpuTimer_gl.cpp b/tools/timer/GpuTimer.cpp
similarity index 84%
rename from bench/BenchGpuTimer_gl.cpp
rename to tools/timer/GpuTimer.cpp
index 349fc1529de6ac32754950f20c1ab5bd6037ecb2..3174449f78cd572e078d84f0b06d7af38ea4f17c 100644
--- a/bench/BenchGpuTimer_gl.cpp
+++ b/tools/timer/GpuTimer.cpp
@@ -5,11 +5,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "BenchGpuTimer_gl.h"
+#include "GpuTimer.h"
#include "gl/SkGLContextHelper.h"
#include "gl/GrGLUtil.h"
-BenchGpuTimer::BenchGpuTimer(const SkGLContextHelper* glctx) {
+GpuTimer::GpuTimer(const SkGLContextHelper* glctx) {
fContext = glctx;
glctx->ref();
glctx->makeCurrent();
@@ -23,7 +23,7 @@ BenchGpuTimer::BenchGpuTimer(const SkGLContextHelper* glctx) {
}
}
-BenchGpuTimer::~BenchGpuTimer() {
+GpuTimer::~GpuTimer() {
if (fSupported) {
fContext->makeCurrent();
SK_GL(*fContext, DeleteQueries(1, &fQuery));
@@ -31,7 +31,7 @@ BenchGpuTimer::~BenchGpuTimer() {
fContext->unref();
}
-void BenchGpuTimer::startGpu() {
+void GpuTimer::start() {
if (fSupported) {
fContext->makeCurrent();
fStarted = true;
@@ -43,7 +43,7 @@ void BenchGpuTimer::startGpu() {
* It is important to stop the cpu clocks first,
* as this will cpu wait for the gpu to finish.
*/
-double BenchGpuTimer::endGpu() {
+double GpuTimer::end() {
if (fSupported) {
fStarted = false;
fContext->makeCurrent();
@@ -52,8 +52,8 @@ double BenchGpuTimer::endGpu() {
GrGLint available = 0;
while (!available) {
SK_GL_NOERRCHECK(*fContext, GetQueryObjectiv(fQuery,
- GR_GL_QUERY_RESULT_AVAILABLE,
- &available));
+ GR_GL_QUERY_RESULT_AVAILABLE,
+ &available));
// If GetQueryObjectiv is erroring out we need some alternative
// means of breaking out of this loop
GrGLenum error;

Powered by Google App Engine
This is Rietveld 408576698