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

Side by Side Diff: examples/spinning_cube/gles2_client_impl.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
« no previous file with comments | « examples/indirect_service/indirect_service_demo.cc ('k') | examples/ui/noodles/noodles_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef GL_GLEXT_PROTOTYPES 5 #ifndef GL_GLEXT_PROTOTYPES
6 #define GL_GLEXT_PROTOTYPES 6 #define GL_GLEXT_PROTOTYPES
7 #endif 7 #endif
8 8
9 #include "examples/spinning_cube/gles2_client_impl.h" 9 #include "examples/spinning_cube/gles2_client_impl.h"
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 break; 128 break;
129 } 129 }
130 default: 130 default:
131 break; 131 break;
132 } 132 }
133 } 133 }
134 134
135 void GLES2ClientImpl::ContextCreated(mojo::CommandBufferPtr command_buffer) { 135 void GLES2ClientImpl::ContextCreated(mojo::CommandBufferPtr command_buffer) {
136 context_ = MGLCreateContext( 136 context_ = MGLCreateContext(
137 MGL_API_VERSION_GLES2, 137 MGL_API_VERSION_GLES2,
138 command_buffer.PassInterface().PassHandle().release().value(), 138 command_buffer.PassInterfaceHandle().PassHandle().release().value(),
139 MGL_NO_CONTEXT, &ContextLostThunk, this, 139 MGL_NO_CONTEXT, &ContextLostThunk, this,
140 mojo::Environment::GetDefaultAsyncWaiter()); 140 mojo::Environment::GetDefaultAsyncWaiter());
141 MGLMakeCurrent(context_); 141 MGLMakeCurrent(context_);
142 cube_.Init(); 142 cube_.Init();
143 WantToDraw(); 143 WantToDraw();
144 } 144 }
145 145
146 void GLES2ClientImpl::ContextLost() { 146 void GLES2ClientImpl::ContextLost() {
147 cube_.OnGLContextLost(); 147 cube_.OnGLContextLost();
148 MGLDestroyContext(context_); 148 MGLDestroyContext(context_);
(...skipping 25 matching lines...) Expand all
174 float delta = static_cast<float>(offset) / 1000000.; 174 float delta = static_cast<float>(offset) / 1000000.;
175 last_time_ = now; 175 last_time_ = now;
176 cube_.UpdateForTimeDelta(delta); 176 cube_.UpdateForTimeDelta(delta);
177 cube_.Draw(); 177 cube_.Draw();
178 178
179 MGLSwapBuffers(); 179 MGLSwapBuffers();
180 WantToDraw(); 180 WantToDraw();
181 } 181 }
182 182
183 } // namespace examples 183 } // namespace examples
OLDNEW
« no previous file with comments | « examples/indirect_service/indirect_service_demo.cc ('k') | examples/ui/noodles/noodles_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698