| Index: tools/kilobench/kilobench.cpp
|
| diff --git a/tools/kilobench/kilobench.cpp b/tools/kilobench/kilobench.cpp
|
| index c0422d81eb6d2bbfbf0bf62990eb1bcd645a6aa9..81238353e215e19c6a0597b9229e7a3f5ce047eb 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;
|
| };
|
|
|
|
|