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

Unified Diff: tools/kilobench/kilobench.cpp

Issue 1815823002: Move SkGLContext and some GrGLInterface implementations to skgputest module (Closed) Base URL: https://chromium.googlesource.com/skia.git@debugobject
Patch Set: fix windows and android? Created 4 years, 9 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 | « tools/gpu/gl/win/CreatePlatformGLContext_win.cpp ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « tools/gpu/gl/win/CreatePlatformGLContext_win.cpp ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698