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

Unified Diff: mojo/gles2/gles2_impl.cc

Issue 2007813003: Remove Mojo GLES2 API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 7 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 | « mojo/gles2/README.md ('k') | mojo/public/c/gles2/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/gles2_impl.cc
diff --git a/mojo/gles2/gles2_impl.cc b/mojo/gles2/gles2_impl.cc
deleted file mode 100644
index c9522f7b4c4ecca6ac63c7071a977bf5c277ddf6..0000000000000000000000000000000000000000
--- a/mojo/gles2/gles2_impl.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdint.h>
-
-#include <utility>
-
-#include "base/lazy_instance.h"
-#include "base/threading/thread_local.h"
-#include "components/mus/public/cpp/gles2_context.h"
-#include "gpu/GLES2/gl2extchromium.h"
-#include "gpu/command_buffer/client/gles2_interface.h"
-// Even though this isn't used here, we need to include it to get the symbols to
-// be exported in component build.
-#include "mojo/public/c/gles2/chromium_extension.h"
-#include "mojo/public/c/gles2/gles2.h"
-
-using mus::GLES2Context;
-
-namespace {
-
-const int32_t kNone = 0x3038; // EGL_NONE
-
-base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky
- g_gpu_interface;
-
-} // namespace
-
-extern "C" {
-MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle,
- const int32_t* attrib_list,
- MojoGLES2ContextLost lost_callback,
- void* closure) {
- mojo::MessagePipeHandle mph(handle);
- mojo::ScopedMessagePipeHandle scoped_handle(mph);
- std::vector<int32_t> attribs;
- if (attrib_list) {
- for (int32_t const* p = attrib_list; *p != kNone;) {
- attribs.push_back(*p++);
- attribs.push_back(*p++);
- }
- }
- attribs.push_back(kNone);
- std::unique_ptr<GLES2Context> client(new GLES2Context(
- attribs, std::move(scoped_handle), lost_callback, closure));
- if (!client->Initialize())
- client.reset();
- return client.release();
-}
-
-void MojoGLES2DestroyContext(MojoGLES2Context context) {
- delete static_cast<GLES2Context*>(context);
-}
-
-void MojoGLES2MakeCurrent(MojoGLES2Context context) {
- gpu::gles2::GLES2Interface* interface = NULL;
- if (context) {
- GLES2Context* client = static_cast<GLES2Context*>(context);
- interface = client->interface();
- DCHECK(interface);
- }
- g_gpu_interface.Get().Set(interface);
-}
-
-void MojoGLES2SwapBuffers() {
- DCHECK(g_gpu_interface.Get().Get());
- g_gpu_interface.Get().Get()->SwapBuffers();
-}
-
-void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) {
- return static_cast<GLES2Context*>(context)->interface();
-}
-
-void* MojoGLES2GetContextSupport(MojoGLES2Context context) {
- return static_cast<GLES2Context*>(context)->context_support();
-}
-
-#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
- ReturnType GL_APIENTRY gl##Function PARAMETERS { \
- DCHECK(g_gpu_interface.Get().Get()); \
- return g_gpu_interface.Get().Get()->Function ARGUMENTS; \
- }
-#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
-#include "mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h"
-#undef VISIT_GL_CALL
-
-} // extern "C"
« no previous file with comments | « mojo/gles2/README.md ('k') | mojo/public/c/gles2/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698