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

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

Issue 1534813003: Use C bindings to Mojo GL entry points exclusively. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-6
Patch Set: rebase 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 | « mojo/gpu/mojo_context_support.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/gpu/mojo_context_support.h"
6
7 #include <MGL/mgl_onscreen.h>
8 #include <MGL/mgl_signal_sync_point.h>
9
10 #include "base/callback.h"
11 #include "base/logging.h"
12
13 namespace mojo {
14 namespace {
15
16 void RunAndDeleteCallback(void* context) {
17 base::Closure* callback = reinterpret_cast<base::Closure*>(context);
18 callback->Run();
19 delete callback;
20 }
21 }
22
23 MojoContextSupport::MojoContextSupport(MGLContext context)
24 : context_(context) {}
25
26 MojoContextSupport::~MojoContextSupport() {
27 }
28
29 void MojoContextSupport::SignalSyncPoint(uint32 sync_point,
30 const base::Closure& callback) {
31 MGLSignalSyncPoint(sync_point, &RunAndDeleteCallback,
32 new base::Closure(callback));
33 }
34
35 void MojoContextSupport::SignalQuery(uint32 query,
36 const base::Closure& callback) {
37 NOTIMPLEMENTED();
38 }
39
40 void MojoContextSupport::SetSurfaceVisible(bool visible) {
41 NOTIMPLEMENTED();
42 }
43
44 void MojoContextSupport::Swap() {
45 MGLMakeCurrent(context_);
46 MGLSwapBuffers();
47 }
48
49 void MojoContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
50 Swap();
51 }
52
53 void MojoContextSupport::ScheduleOverlayPlane(
54 int plane_z_order,
55 gfx::OverlayTransform plane_transform,
56 unsigned overlay_texture_id,
57 const gfx::Rect& display_bounds,
58 const gfx::RectF& uv_rect) {
59 NOTIMPLEMENTED();
60 }
61
62 uint32 MojoContextSupport::InsertFutureSyncPointCHROMIUM() {
63 NOTIMPLEMENTED();
64 return 0u;
65 }
66
67 void MojoContextSupport::RetireSyncPointCHROMIUM(uint32 sync_point) {
68 NOTIMPLEMENTED();
69 }
70
71 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/gpu/mojo_context_support.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698