Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: gpu/gles2_conform_support/egl/display.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: benchmark Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | mojo/examples/aura_demo/demo_context_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
232 233
233 context_.reset(new gpu::gles2::GLES2Implementation( 234 context_.reset(
234 gles2_cmd_helper_.get(), 235 new gpu::gles2::GLES2Implementation(gles2_cmd_helper_.get(),
235 NULL, 236 NULL,
236 transfer_buffer_.get(), 237 transfer_buffer_.get(),
237 bind_generates_resources, 238 bind_generates_resources,
238 gpu_control_.get())); 239 lose_context_when_out_of_memory,
240 gpu_control_.get()));
239 241
240 if (!context_->Initialize( 242 if (!context_->Initialize(
241 kTransferBufferSize, 243 kTransferBufferSize,
242 kTransferBufferSize / 2, 244 kTransferBufferSize / 2,
243 kTransferBufferSize * 2, 245 kTransferBufferSize * 2,
244 gpu::gles2::GLES2Implementation::kNoLimit)) { 246 gpu::gles2::GLES2Implementation::kNoLimit)) {
245 return EGL_NO_CONTEXT; 247 return EGL_NO_CONTEXT;
246 } 248 }
247 249
248 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); 250 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets");
(...skipping 14 matching lines...) Expand all
263 } else { 265 } else {
264 DCHECK(IsValidSurface(draw)); 266 DCHECK(IsValidSurface(draw));
265 DCHECK(IsValidSurface(read)); 267 DCHECK(IsValidSurface(read));
266 DCHECK(IsValidContext(ctx)); 268 DCHECK(IsValidContext(ctx));
267 gles2::SetGLContext(context_.get()); 269 gles2::SetGLContext(context_.get());
268 } 270 }
269 return true; 271 return true;
270 } 272 }
271 273
272 } // namespace egl 274 } // namespace egl
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | mojo/examples/aura_demo/demo_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698