aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/debug
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2015-06-23 13:23:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-23 13:23:44 -0700
commitd416a5b10ff9e6d4f55a1f5b0419722132d68ff3 (patch)
treef9f39528fd8fd7c033882c137d711e12939c6fa2 /src/gpu/gl/debug
parentb607767703ff7898611cf88c1218d5d69535e984 (diff)
Implement SkGLContext swapBuffers with fence syncs
Improves the GPU measuring accuracy of nanobench by using fence syncs. Fence syncs are very widely supported and available on almost every platform. NO_MERGE_BUILDS BUG=skia: Review URL: https://codereview.chromium.org/1194783003
Diffstat (limited to 'src/gpu/gl/debug')
-rw-r--r--src/gpu/gl/debug/SkDebugGLContext.cpp4
-rw-r--r--src/gpu/gl/debug/SkDebugGLContext.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gpu/gl/debug/SkDebugGLContext.cpp b/src/gpu/gl/debug/SkDebugGLContext.cpp
index ae55104d46..531e6c3ab8 100644
--- a/src/gpu/gl/debug/SkDebugGLContext.cpp
+++ b/src/gpu/gl/debug/SkDebugGLContext.cpp
@@ -9,9 +9,9 @@
#include "gl/debug/SkDebugGLContext.h"
SkDebugGLContext::SkDebugGLContext() {
- fGL.reset(GrGLCreateDebugInterface());
+ this->init(GrGLCreateDebugInterface());
}
SkDebugGLContext::~SkDebugGLContext() {
- fGL.reset(NULL);
+ this->teardown();
}
diff --git a/src/gpu/gl/debug/SkDebugGLContext.h b/src/gpu/gl/debug/SkDebugGLContext.h
index 577953223a..6a4d9fc38b 100644
--- a/src/gpu/gl/debug/SkDebugGLContext.h
+++ b/src/gpu/gl/debug/SkDebugGLContext.h
@@ -13,8 +13,6 @@
class SkDebugGLContext : public SkGLContext {
public:
~SkDebugGLContext() override;
- void makeCurrent() const override {}
- void swapBuffers() const override {}
static SkDebugGLContext* Create(GrGLStandard forcedGpuAPI) {
if (kGLES_GrGLStandard == forcedGpuAPI) {
@@ -23,6 +21,10 @@ public:
return SkNEW(SkDebugGLContext);
}
private:
+ void onPlatformMakeCurrent() const override {}
+ void onPlatformSwapBuffers() const override {}
+ GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return NULL; }
+
SkDebugGLContext();
};