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

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

Issue 23130004: Enforce a memory limit on MappedMemoryManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another namespace error Created 7 years, 4 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
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 context_.reset(new gpu::gles2::GLES2Implementation( 227 context_.reset(new gpu::gles2::GLES2Implementation(
228 gles2_cmd_helper_.get(), 228 gles2_cmd_helper_.get(),
229 NULL, 229 NULL,
230 transfer_buffer_.get(), 230 transfer_buffer_.get(),
231 true, 231 true,
232 NULL)); 232 NULL));
233 233
234 if (!context_->Initialize( 234 if (!context_->Initialize(
235 kTransferBufferSize, 235 kTransferBufferSize,
236 kTransferBufferSize / 2, 236 kTransferBufferSize / 2,
237 kTransferBufferSize * 2)) { 237 kTransferBufferSize * 2,
238 gpu::gles2::GLES2Implementation::kNoLimit)) {
238 return EGL_NO_CONTEXT; 239 return EGL_NO_CONTEXT;
239 } 240 }
240 241
241 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); 242 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets");
242 context_->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); 243 context_->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs");
243 244
244 return context_.get(); 245 return context_.get();
245 } 246 }
246 247
247 void Display::DestroyContext(EGLContext ctx) { 248 void Display::DestroyContext(EGLContext ctx) {
248 DCHECK(IsValidContext(ctx)); 249 DCHECK(IsValidContext(ctx));
249 context_.reset(); 250 context_.reset();
250 transfer_buffer_.reset(); 251 transfer_buffer_.reset();
251 } 252 }
252 253
253 bool Display::MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx) { 254 bool Display::MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx) {
254 if (ctx == EGL_NO_CONTEXT) { 255 if (ctx == EGL_NO_CONTEXT) {
255 gles2::SetGLContext(NULL); 256 gles2::SetGLContext(NULL);
256 } else { 257 } else {
257 DCHECK(IsValidSurface(draw)); 258 DCHECK(IsValidSurface(draw));
258 DCHECK(IsValidSurface(read)); 259 DCHECK(IsValidSurface(read));
259 DCHECK(IsValidContext(ctx)); 260 DCHECK(IsValidContext(ctx));
260 gles2::SetGLContext(context_.get()); 261 gles2::SetGLContext(context_.get());
261 } 262 }
262 return true; 263 return true;
263 } 264 }
264 265
265 } // namespace egl 266 } // namespace egl
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698