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

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: 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
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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 display_info.GetDisplayHeight() * 511 display_info.GetDisplayHeight() *
512 display_info.GetDisplayWidth() * 512 display_info.GetDisplayWidth() *
513 kBytesPerPixel; 513 kBytesPerPixel;
514 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 514 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
515 limits.command_buffer_size = 64 * 1024; 515 limits.command_buffer_size = 64 * 1024;
516 limits.start_transfer_buffer_size = 64 * 1024; 516 limits.start_transfer_buffer_size = 64 * 1024;
517 limits.min_transfer_buffer_size = 64 * 1024; 517 limits.min_transfer_buffer_size = 64 * 1024;
518 limits.max_transfer_buffer_size = std::min( 518 limits.max_transfer_buffer_size = std::min(
519 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 519 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
520 limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024; 520 limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024;
521 bool bind_generates_resource = false;
522 bool lose_context_when_out_of_memory = true;
521 return make_scoped_ptr( 523 return make_scoped_ptr(
522 new WebGraphicsContext3DCommandBufferImpl(surface_id, 524 new WebGraphicsContext3DCommandBufferImpl(surface_id,
523 url, 525 url,
524 gpu_channel_host.get(), 526 gpu_channel_host.get(),
525 attributes, 527 attributes,
526 false, 528 bind_generates_resource,
529 lose_context_when_out_of_memory,
527 limits, 530 limits,
528 NULL)); 531 NULL));
529 } 532 }
530 533
531 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( 534 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface(
532 bool fallback) { 535 bool fallback) {
533 blink::WebGraphicsContext3D::Attributes attrs; 536 blink::WebGraphicsContext3D::Attributes attrs;
534 attrs.shareResources = true; 537 attrs.shareResources = true;
535 attrs.noAutomaticFlushes = true; 538 attrs.noAutomaticFlushes = true;
536 539
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 588
586 void CompositorImpl::DidCommit() { 589 void CompositorImpl::DidCommit() {
587 root_window_->OnCompositingDidCommit(); 590 root_window_->OnCompositingDidCommit();
588 } 591 }
589 592
590 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { 593 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) {
591 root_layer_->AddChild(layer); 594 root_layer_->AddChild(layer);
592 } 595 }
593 596
594 } // namespace content 597 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_ipc_browsertests.cc ('k') | content/browser/renderer_host/image_transport_factory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698