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 "gpu/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 const EGLint* attrib_list) { | 222 const EGLint* attrib_list) { |
223 DCHECK(IsValidConfig(config)); | 223 DCHECK(IsValidConfig(config)); |
224 // TODO(alokp): Add support for shared contexts. | 224 // TODO(alokp): Add support for shared contexts. |
225 if (share_ctx != NULL) | 225 if (share_ctx != NULL) |
226 return EGL_NO_CONTEXT; | 226 return EGL_NO_CONTEXT; |
227 | 227 |
228 DCHECK(command_buffer_ != NULL); | 228 DCHECK(command_buffer_ != NULL); |
229 DCHECK(transfer_buffer_.get()); | 229 DCHECK(transfer_buffer_.get()); |
230 | 230 |
231 bool bind_generates_resources = true; | 231 bool bind_generates_resources = true; |
232 bool lose_context_when_out_of_memory = false; | |
233 | 232 |
234 context_.reset( | 233 context_.reset(new gpu::gles2::GLES2Implementation( |
235 new gpu::gles2::GLES2Implementation(gles2_cmd_helper_.get(), | 234 gles2_cmd_helper_.get(), |
236 NULL, | 235 NULL, |
237 transfer_buffer_.get(), | 236 transfer_buffer_.get(), |
238 bind_generates_resources, | 237 bind_generates_resources, |
239 lose_context_when_out_of_memory, | 238 gpu_control_.get())); |
240 gpu_control_.get())); | |
241 | 239 |
242 if (!context_->Initialize( | 240 if (!context_->Initialize( |
243 kTransferBufferSize, | 241 kTransferBufferSize, |
244 kTransferBufferSize / 2, | 242 kTransferBufferSize / 2, |
245 kTransferBufferSize * 2, | 243 kTransferBufferSize * 2, |
246 gpu::gles2::GLES2Implementation::kNoLimit)) { | 244 gpu::gles2::GLES2Implementation::kNoLimit)) { |
247 return EGL_NO_CONTEXT; | 245 return EGL_NO_CONTEXT; |
248 } | 246 } |
249 | 247 |
250 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); | 248 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); |
(...skipping 14 matching lines...) Expand all Loading... |
265 } else { | 263 } else { |
266 DCHECK(IsValidSurface(draw)); | 264 DCHECK(IsValidSurface(draw)); |
267 DCHECK(IsValidSurface(read)); | 265 DCHECK(IsValidSurface(read)); |
268 DCHECK(IsValidContext(ctx)); | 266 DCHECK(IsValidContext(ctx)); |
269 gles2::SetGLContext(context_.get()); | 267 gles2::SetGLContext(context_.get()); |
270 } | 268 } |
271 return true; | 269 return true; |
272 } | 270 } |
273 | 271 |
274 } // namespace egl | 272 } // namespace egl |
OLD | NEW |