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

Unified Diff: tools/gpu/gl/null/NullGLContext.cpp

Issue 1815823002: Move SkGLContext and some GrGLInterface implementations to skgputest module (Closed) Base URL: https://chromium.googlesource.com/skia.git@debugobject
Patch Set: Address comments 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
Index: tools/gpu/gl/null/NullGLContext.cpp
diff --git a/tools/gpu/gl/null/NullGLContext.cpp b/tools/gpu/gl/null/NullGLContext.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..331ed1090dceea656a3a79e4f3c7b13babcdeb1c
--- /dev/null
+++ b/tools/gpu/gl/null/NullGLContext.cpp
@@ -0,0 +1,38 @@
+
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "NullGLContext.h"
+#include "gl/GrGLInterface.h"
+
+// TODO: Move the GrGLCreateNullInterface implementation here when Chromium is no longer using it
+// in its implementation.
+
+namespace {
+class NullGLContext : public sk_gpu_test::GLContext {
+public:
+ NullGLContext() { this->init(GrGLCreateNullInterface()); }
+ ~NullGLContext() override { this->teardown(); }
+
+private:
+ void onPlatformMakeCurrent() const override {};
+ void onPlatformSwapBuffers() const override {}
+ GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nullptr; }
+};
+} // anonymous namespace
+
+namespace sk_gpu_test {
+GLContext* CreateNullGLContext() {
+ GLContext* ctx = new NullGLContext();
+ if (ctx->isValid()) {
+ return ctx;
+ }
+ delete ctx;
+ return nullptr;
+}
+} // namespace sk_gpu_test
+

Powered by Google App Engine
This is Rietveld 408576698