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/shared_memory_limits.h" |
10 #include "gpu/command_buffer/client/transfer_buffer.h" | 11 #include "gpu/command_buffer/client/transfer_buffer.h" |
11 #include "gpu/command_buffer/common/sync_token.h" | 12 #include "gpu/command_buffer/common/sync_token.h" |
12 #include "ppapi/c/pp_errors.h" | 13 #include "ppapi/c/pp_errors.h" |
13 | 14 |
14 namespace ppapi { | 15 namespace ppapi { |
15 | 16 |
16 PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(PP_Instance instance) | 17 PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(PP_Instance instance) |
17 : Resource(OBJECT_IS_IMPL, instance) {} | 18 : Resource(OBJECT_IS_IMPL, instance) {} |
18 | 19 |
19 PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(const HostResource& host_resource) | 20 PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(const HostResource& host_resource) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( | 137 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( |
137 gles2_helper_.get(), | 138 gles2_helper_.get(), |
138 share_gles2 ? share_gles2->share_group() : NULL, | 139 share_gles2 ? share_gles2->share_group() : NULL, |
139 transfer_buffer_.get(), | 140 transfer_buffer_.get(), |
140 bind_creates_resources, | 141 bind_creates_resources, |
141 lose_context_when_out_of_memory, | 142 lose_context_when_out_of_memory, |
142 support_client_side_arrays, | 143 support_client_side_arrays, |
143 GetGpuControl())); | 144 GetGpuControl())); |
144 | 145 |
145 if (!gles2_impl_->Initialize( | 146 if (!gles2_impl_->Initialize( |
146 transfer_buffer_size, | 147 transfer_buffer_size, kMinTransferBufferSize, |
147 kMinTransferBufferSize, | 148 std::max(kMaxTransferBufferSize, transfer_buffer_size), |
148 std::max(kMaxTransferBufferSize, transfer_buffer_size), | 149 gpu::SharedMemoryLimits::kNoLimit)) { |
149 gpu::gles2::GLES2Implementation::kNoLimit)) { | |
150 return false; | 150 return false; |
151 } | 151 } |
152 | 152 |
153 gles2_impl_->TraceBeginCHROMIUM("gpu_toplevel", "PPAPIContext"); | 153 gles2_impl_->TraceBeginCHROMIUM("gpu_toplevel", "PPAPIContext"); |
154 | 154 |
155 return true; | 155 return true; |
156 } | 156 } |
157 | 157 |
158 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { | 158 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { |
159 gles2_impl_.reset(); | 159 gles2_impl_.reset(); |
160 transfer_buffer_.reset(); | 160 transfer_buffer_.reset(); |
161 gles2_helper_.reset(); | 161 gles2_helper_.reset(); |
162 } | 162 } |
163 | 163 |
164 } // namespace ppapi | 164 } // namespace ppapi |
OLD | NEW |