OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/gles2/control_thunks_impl.h" | 5 #include "mojo/gles2/control_thunks_impl.h" |
6 | 6 |
7 #include "mojo/gles2/gles2_context.h" | 7 #include "mojo/gles2/gles2_context.h" |
8 #include "mojo/public/cpp/system/message_pipe.h" | 8 #include "mojo/public/cpp/system/message_pipe.h" |
9 | 9 |
10 namespace gles2 { | 10 namespace gles2 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 current_context_tls_.Get()->interface()->SwapBuffers(); | 52 current_context_tls_.Get()->interface()->SwapBuffers(); |
53 } | 53 } |
54 | 54 |
55 void* ControlThunksImpl::GetGLES2Interface(MojoGLES2Context context) { | 55 void* ControlThunksImpl::GetGLES2Interface(MojoGLES2Context context) { |
56 GLES2Context* client = reinterpret_cast<GLES2Context*>(context); | 56 GLES2Context* client = reinterpret_cast<GLES2Context*>(context); |
57 DCHECK(client); | 57 DCHECK(client); |
58 return client->interface(); | 58 return client->interface(); |
59 } | 59 } |
60 | 60 |
61 void ControlThunksImpl::SignalSyncPoint( | 61 void ControlThunksImpl::SignalSyncPoint( |
62 MojoGLES2Context context, | |
63 uint32_t sync_point, | 62 uint32_t sync_point, |
64 MojoGLES2SignalSyncPointCallback callback, | 63 MojoGLES2SignalSyncPointCallback callback, |
65 void* closure) { | 64 void* closure) { |
66 current_context_tls_.Get()->context_support()->SignalSyncPoint( | 65 current_context_tls_.Get()->context_support()->SignalSyncPoint( |
67 sync_point, base::Bind(callback, closure)); | 66 sync_point, base::Bind(callback, closure)); |
68 } | 67 } |
69 | 68 |
70 gpu::gles2::GLES2Interface* ControlThunksImpl::CurrentGLES2Interface() { | 69 gpu::gles2::GLES2Interface* ControlThunksImpl::CurrentGLES2Interface() { |
71 if (!current_context_tls_.Get()) | 70 if (!current_context_tls_.Get()) |
72 return nullptr; | 71 return nullptr; |
73 return current_context_tls_.Get()->interface(); | 72 return current_context_tls_.Get()->interface(); |
74 } | 73 } |
75 | 74 |
76 ControlThunksImpl::ControlThunksImpl() { | 75 ControlThunksImpl::ControlThunksImpl() { |
77 } | 76 } |
78 | 77 |
79 ControlThunksImpl::~ControlThunksImpl() { | 78 ControlThunksImpl::~ControlThunksImpl() { |
80 } | 79 } |
81 | 80 |
82 } // namespace gles2 | 81 } // namespace gles2 |
OLD | NEW |