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

Unified Diff: tools/gpu/gl/GLTestContext.h

Issue 2383383002: Move GPU fences into sk_gpu_test (Closed)
Patch Set: fix for windowsx Created 4 years, 2 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/TestContext.h ('k') | tools/gpu/gl/GLTestContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gpu/gl/GLTestContext.h
diff --git a/tools/gpu/gl/GLTestContext.h b/tools/gpu/gl/GLTestContext.h
index efe9d8f100f7f36f9792ad26f1a83fd9fece5763..0cd9762f8bd5b148a8ffb3d14e2871f657624168 100644
--- a/tools/gpu/gl/GLTestContext.h
+++ b/tools/gpu/gl/GLTestContext.h
@@ -59,27 +59,39 @@ public:
*/
virtual GLTestContext *createNew() const { return nullptr; }
+ template<typename Ret, typename... Args>
+ void getGLProcAddress(Ret(GR_GL_FUNCTION_TYPE** out)(Args...),
+ const char* name, const char* ext = nullptr) const {
+ using Proc = Ret(GR_GL_FUNCTION_TYPE*)(Args...);
+ if (!SkStrStartsWith(name, "gl")) {
+ SkFAIL("getGLProcAddress: proc name must have 'gl' prefix");
+ *out = nullptr;
+ } else if (ext) {
+ SkString fullname(name);
+ fullname.append(ext);
+ *out = reinterpret_cast<Proc>(this->onPlatformGetProcAddress(fullname.c_str()));
+ } else {
+ *out = reinterpret_cast<Proc>(this->onPlatformGetProcAddress(name));
+ }
+ }
+
protected:
GLTestContext();
/*
* Methods that sublcasses must call from their constructors and destructors.
*/
- void init(const GrGLInterface *, SkGpuFenceSync * = NULL);
+ void init(const GrGLInterface *, FenceSync* = nullptr);
void teardown() override;
virtual GrGLFuncPtr onPlatformGetProcAddress(const char *) const = 0;
private:
- class GLFenceSync; // SkGpuFenceSync implementation that uses the OpenGL functionality.
-
/** Subclass provides the gl interface object if construction was
* successful. */
SkAutoTUnref<const GrGLInterface> fGL;
- friend class GLFenceSync; // For onPlatformGetProcAddress.
-
typedef TestContext INHERITED;
};
« no previous file with comments | « tools/gpu/TestContext.h ('k') | tools/gpu/gl/GLTestContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698