OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/graphics_3d_impl.h" | 5 #include "ppapi/shared_impl/graphics_3d_impl.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 "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 command_buffer->GetTransferBuffer(transfer_buffer_id_); | 85 command_buffer->GetTransferBuffer(transfer_buffer_id_); |
86 if (!transfer_buffer.ptr) | 86 if (!transfer_buffer.ptr) |
87 return false; | 87 return false; |
88 | 88 |
89 // Create the object exposing the OpenGL API. | 89 // Create the object exposing the OpenGL API. |
90 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( | 90 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( |
91 gles2_helper_.get(), | 91 gles2_helper_.get(), |
92 transfer_buffer.size, | 92 transfer_buffer.size, |
93 transfer_buffer.ptr, | 93 transfer_buffer.ptr, |
94 transfer_buffer_id_, | 94 transfer_buffer_id_, |
95 false)); | 95 false, |
| 96 true)); |
96 | 97 |
97 return true; | 98 return true; |
98 } | 99 } |
99 | 100 |
100 void Graphics3DImpl::DestroyGLES2Impl() { | 101 void Graphics3DImpl::DestroyGLES2Impl() { |
101 gles2_impl_.reset(); | 102 gles2_impl_.reset(); |
102 | 103 |
103 if (transfer_buffer_id_ != -1) { | 104 if (transfer_buffer_id_ != -1) { |
104 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); | 105 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); |
105 DCHECK(command_buffer); | 106 DCHECK(command_buffer); |
106 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); | 107 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); |
107 transfer_buffer_id_ = -1; | 108 transfer_buffer_id_ = -1; |
108 } | 109 } |
109 | 110 |
110 gles2_helper_.reset(); | 111 gles2_helper_.reset(); |
111 } | 112 } |
112 | 113 |
113 } // namespace ppapi | 114 } // namespace ppapi |
114 | 115 |
OLD | NEW |