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

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: 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/null/NullGLContext.h ('k') | tools/gpu/gl/win/CreatePlatformGLContext_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gpu/gl/null/NullGLContext.cpp
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/tools/gpu/gl/null/NullGLContext.cpp
similarity index 96%
copy from src/gpu/gl/GrGLCreateNullInterface.cpp
copy to tools/gpu/gl/null/NullGLContext.cpp
index b9a29fb7421d3a117f3768d0a84b6ea613ae454a..4781c90e4f1b201f5326db19ec693d989c554067 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/tools/gpu/gl/null/NullGLContext.cpp
@@ -1,3 +1,4 @@
+
/*
* Copyright 2011 Google Inc.
*
@@ -5,14 +6,14 @@
* found in the LICENSE file.
*/
-
+#include "NullGLContext.h"
+#include "gl/GrGLTestInterface.h"
+#include "gl/GrGLDefines.h"
#include "gl/GrGLInterface.h"
-#include "GrGLTestInterface.h"
+#include "gl/GrGLTypes.h"
#include "SkMutex.h"
#include "SkTDArray.h"
-// added to suppress 'no previous prototype' warning and because this code is duplicated in
-// SkNullGLContext.cpp
namespace {
class BufferObj {
@@ -114,7 +115,6 @@ public:
, fCurrElementArrayBuffer(0)
, fCurrPixelPackBuffer(0)
, fCurrPixelUnpackBuffer(0)
- , fCurrProgramID(0)
, fCurrShaderID(0)
, fCurrGenericID(0)
, fCurrUniformLocation(0) {
@@ -185,7 +185,7 @@ public:
}
}
- // deleting a bound buffer has the side effect of binding 0
+ // deleting a bound buffer has the side effect of binding 0
GrGLvoid deleteBuffers(GrGLsizei n, const GrGLuint* ids) override {
for (int i = 0; i < n; ++i) {
if (ids[i] == fCurrArrayBuffer) {
@@ -605,6 +605,26 @@ const char* NullInterface::kExtensions[] = {
nullptr, // signifies the end of the array.
};
+class NullGLContext : public sk_gpu_test::GLContext {
+public:
+ NullGLContext() { this->init(new NullInterface); }
+ ~NullGLContext() override { this->teardown(); }
+
+private:
+ void onPlatformMakeCurrent() const override {};
+ void onPlatformSwapBuffers() const override {}
+ GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nullptr; }
+};
} // anonymous namespace
-const GrGLInterface* GrGLCreateNullInterface() { return new NullInterface; }
+namespace sk_gpu_test {
+GLContext* CreateNullGLContext() {
+ GLContext* ctx = new NullGLContext();
+ if (ctx->isValid()) {
+ return ctx;
+ }
+ delete ctx;
+ return nullptr;
+}
+} // namespace sk_gpu_test
+
« no previous file with comments | « tools/gpu/gl/null/NullGLContext.h ('k') | tools/gpu/gl/win/CreatePlatformGLContext_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698