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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); | 118 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); |
119 | 119 |
120 const bool bind_creates_resources = true; | 120 const bool bind_creates_resources = true; |
121 | 121 |
122 // Create the object exposing the OpenGL API. | 122 // Create the object exposing the OpenGL API. |
123 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( | 123 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( |
124 gles2_helper_.get(), | 124 gles2_helper_.get(), |
125 share_gles2 ? share_gles2->share_group() : NULL, | 125 share_gles2 ? share_gles2->share_group() : NULL, |
126 transfer_buffer_.get(), | 126 transfer_buffer_.get(), |
127 bind_creates_resources, | 127 bind_creates_resources, |
128 GetGpuControl())); | 128 GetGpuControl(), |
| 129 // TODO(boliu): Need to implement this to use cc in Pepper. Tracked in |
| 130 // crbug.com/325391. |
| 131 gpu::Capabilities())); |
129 | 132 |
130 if (!gles2_impl_->Initialize( | 133 if (!gles2_impl_->Initialize( |
131 transfer_buffer_size, | 134 transfer_buffer_size, |
132 kMinTransferBufferSize, | 135 kMinTransferBufferSize, |
133 std::max(kMaxTransferBufferSize, transfer_buffer_size), | 136 std::max(kMaxTransferBufferSize, transfer_buffer_size), |
134 gpu::gles2::GLES2Implementation::kNoLimit)) { | 137 gpu::gles2::GLES2Implementation::kNoLimit)) { |
135 return false; | 138 return false; |
136 } | 139 } |
137 | 140 |
138 gles2_impl_->PushGroupMarkerEXT(0, "PPAPIContext"); | 141 gles2_impl_->PushGroupMarkerEXT(0, "PPAPIContext"); |
139 | 142 |
140 return true; | 143 return true; |
141 } | 144 } |
142 | 145 |
143 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { | 146 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { |
144 gles2_impl_.reset(); | 147 gles2_impl_.reset(); |
145 transfer_buffer_.reset(); | 148 transfer_buffer_.reset(); |
146 gles2_helper_.reset(); | 149 gles2_helper_.reset(); |
147 } | 150 } |
148 | 151 |
149 } // namespace ppapi | 152 } // namespace ppapi |
OLD | NEW |