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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2016 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #include "NullGLContext.h"
10 #include "gl/GrGLInterface.h"
11
12 // TODO: Move the GrGLCreateNullInterface implementation here when Chromium is n o longer using it
13 // in its implementation.
14
15 namespace {
16 class NullGLContext : public sk_gpu_test::GLContext {
17 public:
18 NullGLContext() { this->init(GrGLCreateNullInterface()); }
19 ~NullGLContext() override { this->teardown(); }
20
21 private:
22 void onPlatformMakeCurrent() const override {};
23 void onPlatformSwapBuffers() const override {}
24 GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nu llptr; }
25 };
26 } // anonymous namespace
27
28 namespace sk_gpu_test {
29 GLContext* CreateNullGLContext() {
30 GLContext* ctx = new NullGLContext();
31 if (ctx->isValid()) {
32 return ctx;
33 }
34 delete ctx;
35 return nullptr;
36 }
37 } // namespace sk_gpu_test
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698