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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 if (HasPendingSwap()) { | 65 if (HasPendingSwap()) { |
66 // Already a pending SwapBuffers that hasn't returned yet. | 66 // Already a pending SwapBuffers that hasn't returned yet. |
67 return PP_ERROR_INPROGRESS; | 67 return PP_ERROR_INPROGRESS; |
68 } | 68 } |
69 | 69 |
70 swap_callback_ = new TrackedCallback(this, callback); | 70 swap_callback_ = new TrackedCallback(this, callback); |
71 return DoSwapBuffers(); | 71 return DoSwapBuffers(); |
72 } | 72 } |
73 | 73 |
| 74 void* PPB_Graphics3D_Shared::MapTexSubImage2DCHROMIUM(GLenum target, |
| 75 GLint level, |
| 76 GLint xoffset, |
| 77 GLint yoffset, |
| 78 GLsizei width, |
| 79 GLsizei height, |
| 80 GLenum format, |
| 81 GLenum type, |
| 82 GLenum access) { |
| 83 return gles2_impl_->MapTexSubImage2DCHROMIUM( |
| 84 target, level, xoffset, yoffset, width, height, format, type, access); |
| 85 } |
| 86 |
| 87 void PPB_Graphics3D_Shared::UnmapTexSubImage2DCHROMIUM(const void* mem) { |
| 88 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); |
| 89 } |
| 90 |
74 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) { | 91 void PPB_Graphics3D_Shared::SwapBuffersACK(int32_t pp_error) { |
75 DCHECK(HasPendingSwap()); | 92 DCHECK(HasPendingSwap()); |
76 TrackedCallback::ClearAndRun(&swap_callback_, pp_error); | 93 TrackedCallback::ClearAndRun(&swap_callback_, pp_error); |
77 } | 94 } |
78 | 95 |
79 bool PPB_Graphics3D_Shared::HasPendingSwap() const { | 96 bool PPB_Graphics3D_Shared::HasPendingSwap() const { |
80 return TrackedCallback::IsPending(swap_callback_); | 97 return TrackedCallback::IsPending(swap_callback_); |
81 } | 98 } |
82 | 99 |
83 bool PPB_Graphics3D_Shared::CreateGLES2Impl(int32 command_buffer_size, | 100 bool PPB_Graphics3D_Shared::CreateGLES2Impl(int32 command_buffer_size, |
(...skipping 30 matching lines...) Expand all Loading... |
114 } | 131 } |
115 | 132 |
116 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { | 133 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { |
117 gles2_impl_.reset(); | 134 gles2_impl_.reset(); |
118 transfer_buffer_.reset(); | 135 transfer_buffer_.reset(); |
119 gles2_helper_.reset(); | 136 gles2_helper_.reset(); |
120 } | 137 } |
121 | 138 |
122 } // namespace ppapi | 139 } // namespace ppapi |
123 | 140 |
OLD | NEW |