aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/kilobench/kilobench.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-03-30 18:56:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-30 18:56:20 -0700
commit3724e574a744491b7cfb8187ac865a70ef3d4528 (patch)
treeeb3dd729cbc0adef5ce2b4a2fa048fe21baeb35a /tools/kilobench/kilobench.cpp
parent2238c9dbca4b791edc512957728a18ce14d55912 (diff)
Move SkGLContext and some GrGLInterface implementations to skgputest module
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Committed: https://skia.googlesource.com/skia/+/fe3456cb006110d045b26ff3f8681b893a757b58 Review URL: https://codereview.chromium.org/1815823002
Diffstat (limited to 'tools/kilobench/kilobench.cpp')
-rw-r--r--tools/kilobench/kilobench.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/kilobench/kilobench.cpp b/tools/kilobench/kilobench.cpp
index c0422d81eb..81238353e2 100644
--- a/tools/kilobench/kilobench.cpp
+++ b/tools/kilobench/kilobench.cpp
@@ -20,6 +20,7 @@
#include "Timer.h"
#include "VisualSKPBench.h"
#include "gl/GrGLDefines.h"
+#include "gl/GrGLUtil.h"
#include "../private/SkMutex.h"
#include "../private/SkSemaphore.h"
#include "../private/SkGpuFenceSync.h"
@@ -29,6 +30,8 @@
#include <sys/types.h>
#include <sys/wait.h>
+using namespace sk_gpu_test;
+
/*
* This is an experimental GPU only benchmarking program. The initial implementation will only
* support SKPs.
@@ -144,14 +147,14 @@ struct GPUTarget {
void setup() {
fGL->makeCurrent();
// Make sure we're done with whatever came before.
- SK_GL(*fGL, Finish());
+ GR_GL_CALL(fGL->gl(), Finish());
}
SkCanvas* beginTiming(SkCanvas* canvas) { return canvas; }
void endTiming(bool usePlatformSwapBuffers) {
if (fGL) {
- SK_GL(*fGL, Flush());
+ GR_GL_CALL(fGL->gl(), Flush());
if (usePlatformSwapBuffers) {
fGL->swapBuffers();
} else {
@@ -160,7 +163,7 @@ struct GPUTarget {
}
}
void finish() {
- SK_GL(*fGL, Finish());
+ GR_GL_CALL(fGL->gl(), Finish());
}
bool needsFrameTiming(int* maxFrameLag) const {
@@ -215,10 +218,10 @@ struct GPUTarget {
return true;
}
- SkGLContext* gl() { return fGL; }
+ GLContext* gl() { return fGL; }
private:
- SkGLContext* fGL;
+ GLContext* fGL;
SkAutoTDelete<SkSurface> fSurface;
};
@@ -279,7 +282,7 @@ static int clamp_loops(int loops) {
static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
struct TimingThread {
- TimingThread(SkGLContext* mainContext)
+ TimingThread(GLContext* mainContext)
: fFenceSync(mainContext->fenceSync())
, fMainContext(mainContext)
, fDone(false) {}
@@ -305,8 +308,8 @@ struct TimingThread {
void timingLoop() {
// Create a context which shares display lists with the main thread
- SkAutoTDelete<SkGLContext> glContext(SkCreatePlatformGLContext(kNone_GrGLStandard,
- fMainContext));
+ SkAutoTDelete<GLContext> glContext(CreatePlatformGLContext(kNone_GrGLStandard,
+ fMainContext));
glContext->makeCurrent();
// Basic timing methodology is:
@@ -402,7 +405,7 @@ private:
SyncQueue fFrameEndSyncs;
SkTArray<double> fTimings;
SkMutex fDoneMutex;
- SkGLContext* fMainContext;
+ GLContext* fMainContext;
bool fDone;
};