OLD | NEW |
| (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 | |
OLD | NEW |