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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.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: gles2impl-tests 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
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 "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 display_info.GetDisplayHeight() * 510 display_info.GetDisplayHeight() *
511 display_info.GetDisplayWidth() * 511 display_info.GetDisplayWidth() *
512 kBytesPerPixel; 512 kBytesPerPixel;
513 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 513 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
514 limits.command_buffer_size = 64 * 1024; 514 limits.command_buffer_size = 64 * 1024;
515 limits.start_transfer_buffer_size = 64 * 1024; 515 limits.start_transfer_buffer_size = 64 * 1024;
516 limits.min_transfer_buffer_size = 64 * 1024; 516 limits.min_transfer_buffer_size = 64 * 1024;
517 limits.max_transfer_buffer_size = std::min( 517 limits.max_transfer_buffer_size = std::min(
518 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 518 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
519 limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024; 519 limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
520 bool bind_generates_resource = false;
521 bool lose_context_when_out_of_memory = true;
520 return make_scoped_ptr( 522 return make_scoped_ptr(
521 new WebGraphicsContext3DCommandBufferImpl(surface_id, 523 new WebGraphicsContext3DCommandBufferImpl(surface_id,
522 url, 524 url,
523 gpu_channel_host.get(), 525 gpu_channel_host.get(),
524 attributes, 526 attributes,
525 false, 527 bind_generates_resource,
528 lose_context_when_out_of_memory,
526 limits, 529 limits,
527 NULL)); 530 NULL));
528 } 531 }
529 532
530 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( 533 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface(
531 bool fallback) { 534 bool fallback) {
532 blink::WebGraphicsContext3D::Attributes attrs; 535 blink::WebGraphicsContext3D::Attributes attrs;
533 attrs.shareResources = true; 536 attrs.shareResources = true;
534 attrs.noAutomaticFlushes = true; 537 attrs.noAutomaticFlushes = true;
535 538
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 587
585 void CompositorImpl::DidCommit() { 588 void CompositorImpl::DidCommit() {
586 root_window_->OnCompositingDidCommit(); 589 root_window_->OnCompositingDidCommit();
587 } 590 }
588 591
589 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { 592 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) {
590 root_layer_->AddChild(layer); 593 root_layer_->AddChild(layer);
591 } 594 }
592 595
593 } // namespace content 596 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698