OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 5 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
10 #include "gpu/command_buffer/client/transfer_buffer.h" | 10 #include "gpu/command_buffer/client/transfer_buffer.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 target, level, xoffset, yoffset, width, height, format, type, access); | 82 target, level, xoffset, yoffset, width, height, format, type, access); |
83 } | 83 } |
84 | 84 |
85 void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) { | 85 void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) { |
86 ScopedNoLocking already_locked(this); | 86 ScopedNoLocking already_locked(this); |
87 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); | 87 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); |
88 } | 88 } |
89 | 89 |
90 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) { | 90 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) { |
91 DCHECK(HasPendingSwap()); | 91 DCHECK(HasPendingSwap()); |
92 TrackedCallback::ClearAndRun(&swap_callback_, pp_error); | 92 swap_callback_->Run(pp_error); |
93 } | 93 } |
94 | 94 |
95 bool PPB_Graphics3D_Shared::HasPendingSwap() const { | 95 bool PPB_Graphics3D_Shared::HasPendingSwap() const { |
96 return TrackedCallback::IsPending(swap_callback_); | 96 return TrackedCallback::IsPending(swap_callback_); |
97 } | 97 } |
98 | 98 |
99 bool PPB_Graphics3D_Shared::CreateGLES2Impl( | 99 bool PPB_Graphics3D_Shared::CreateGLES2Impl( |
100 int32 command_buffer_size, | 100 int32 command_buffer_size, |
101 int32 transfer_buffer_size, | 101 int32 transfer_buffer_size, |
102 gpu::gles2::GLES2Implementation* share_gles2) { | 102 gpu::gles2::GLES2Implementation* share_gles2) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void PPB_Graphics3D_Shared::PushAlreadyLocked() { | 145 void PPB_Graphics3D_Shared::PushAlreadyLocked() { |
146 // Do nothing. This should be overridden in the plugin side. | 146 // Do nothing. This should be overridden in the plugin side. |
147 } | 147 } |
148 | 148 |
149 void PPB_Graphics3D_Shared::PopAlreadyLocked() { | 149 void PPB_Graphics3D_Shared::PopAlreadyLocked() { |
150 // Do nothing. This should be overridden in the plugin side. | 150 // Do nothing. This should be overridden in the plugin side. |
151 } | 151 } |
152 | 152 |
153 } // namespace ppapi | 153 } // namespace ppapi |
154 | 154 |
OLD | NEW |