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

Unified Diff: mojo/public/bindings/gles2_client/gles2_client_impl.cc

Issue 101413002: [Mojo] Remove dependency between mojo/public and gpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/public/bindings/gles2_client/gles2_client_impl.h ('k') | mojo/public/gles2/gles2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/gles2_client/gles2_client_impl.cc
diff --git a/mojo/public/bindings/gles2_client/gles2_client_impl.cc b/mojo/public/bindings/gles2_client/gles2_client_impl.cc
deleted file mode 100644
index 2fea93ce6772d0caea04b9d7a7876063bda3a3e9..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/gles2_client/gles2_client_impl.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2013 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 "mojo/public/bindings/gles2_client/gles2_client_impl.h"
-
-#include <assert.h>
-
-#include "gpu/command_buffer/client/gles2_lib.h"
-
-namespace mojo {
-namespace {
-
-bool g_gles2_initialized = false;
-
-} // namespace
-
-GLES2Delegate::~GLES2Delegate() {
-}
-
-void GLES2Delegate::DidCreateContext(
- GLES2ClientImpl* gl, uint32_t width, uint32_t height) {
-}
-
-void GLES2Delegate::ContextLost(GLES2ClientImpl* gl) {
-}
-
-GLES2ClientImpl::GLES2ClientImpl(GLES2Delegate* delegate,
- ScopedMessagePipeHandle gl)
- : delegate_(delegate),
- gl_(gl.Pass()) {
- assert(g_gles2_initialized);
- gl_.SetPeer(this);
-}
-
-GLES2ClientImpl::~GLES2ClientImpl() {
- gl_->Destroy();
-}
-
-void GLES2ClientImpl::Initialize() {
- assert(!g_gles2_initialized);
- gles2::Initialize();
- g_gles2_initialized = true;
-}
-
-void GLES2ClientImpl::Terminate() {
- assert(g_gles2_initialized);
- gles2::Terminate();
- g_gles2_initialized = false;
-}
-
-void GLES2ClientImpl::SwapBuffers() {
- gles2::GetGLContext()->SwapBuffers();
-}
-
-void GLES2ClientImpl::DidCreateContext(
- uint64_t encoded, uint32_t width, uint32_t height) {
- // Ack, Hans! It's the giant hack.
- // TODO(abarth): Replace this hack with something more disciplined. Most
- // likley, we should receive a MojoHandle that we use to wire up the
- // client side of an out-of-process command buffer. Given that we're
- // still in-process, we just reinterpret_cast the value into a GL interface.
- gpu::gles2::GLES2Interface* gl_interface =
- reinterpret_cast<gpu::gles2::GLES2Interface*>(
- static_cast<uintptr_t>(encoded));
- gles2::SetGLContext(gl_interface);
-
- delegate_->DidCreateContext(this, width, height);
-}
-
-void GLES2ClientImpl::ContextLost() {
- delegate_->ContextLost(this);
-}
-
-} // mojo
« no previous file with comments | « mojo/public/bindings/gles2_client/gles2_client_impl.h ('k') | mojo/public/gles2/gles2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698