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

Side by Side Diff: mojo/gpu/gl_context.cc

Issue 1677753002: Mojo C++ bindings: InterfacePtr::PassInterface -> PassInterfaceHandle (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/gpu/gl_context.h" 5 #include "mojo/gpu/gl_context.h"
6 6
7 #include "mojo/public/cpp/application/connect.h" 7 #include "mojo/public/cpp/application/connect.h"
8 #include "mojo/public/interfaces/application/application_connector.mojom.h" 8 #include "mojo/public/interfaces/application/application_connector.mojom.h"
9 #include "mojo/services/gpu/interfaces/gpu.mojom.h" 9 #include "mojo/services/gpu/interfaces/gpu.mojom.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 GLContext::Observer::~Observer() {} 13 GLContext::Observer::~Observer() {}
14 14
15 GLContext::GLContext(CommandBufferPtr command_buffer) : weak_factory_(this) { 15 GLContext::GLContext(CommandBufferPtr command_buffer) : weak_factory_(this) {
16 context_ = MGLCreateContext( 16 context_ = MGLCreateContext(
17 MGL_API_VERSION_GLES2, 17 MGL_API_VERSION_GLES2,
18 command_buffer.PassInterface().PassHandle().release().value(), 18 command_buffer.PassInterfaceHandle().PassHandle().release().value(),
19 MGL_NO_CONTEXT, &ContextLostThunk, this, 19 MGL_NO_CONTEXT, &ContextLostThunk, this,
20 Environment::GetDefaultAsyncWaiter()); 20 Environment::GetDefaultAsyncWaiter());
21 DCHECK(context_ != MGL_NO_CONTEXT); 21 DCHECK(context_ != MGL_NO_CONTEXT);
22 } 22 }
23 23
24 GLContext::~GLContext() { 24 GLContext::~GLContext() {
25 MGLDestroyContext(context_); 25 MGLDestroyContext(context_);
26 } 26 }
27 27
28 base::WeakPtr<GLContext> GLContext::CreateOffscreen( 28 base::WeakPtr<GLContext> GLContext::CreateOffscreen(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 void GLContext::ContextLostThunk(void* self) { 65 void GLContext::ContextLostThunk(void* self) {
66 static_cast<GLContext*>(self)->OnContextLost(); 66 static_cast<GLContext*>(self)->OnContextLost();
67 } 67 }
68 68
69 void GLContext::OnContextLost() { 69 void GLContext::OnContextLost() {
70 FOR_EACH_OBSERVER(Observer, observers_, OnContextLost()); 70 FOR_EACH_OBSERVER(Observer, observers_, OnContextLost());
71 } 71 }
72 72
73 } // namespace mojo 73 } // namespace mojo
OLDNEW
« no previous file with comments | « examples/ui/noodles/noodles_view.cc ('k') | mojo/public/cpp/application/lib/application_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698