| 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 "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 Loading... |
| 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; | |
| 522 return make_scoped_ptr( | 520 return make_scoped_ptr( |
| 523 new WebGraphicsContext3DCommandBufferImpl(surface_id, | 521 new WebGraphicsContext3DCommandBufferImpl(surface_id, |
| 524 url, | 522 url, |
| 525 gpu_channel_host.get(), | 523 gpu_channel_host.get(), |
| 526 attributes, | 524 attributes, |
| 527 bind_generates_resource, | 525 false, |
| 528 lose_context_when_out_of_memory, | |
| 529 limits, | 526 limits, |
| 530 NULL)); | 527 NULL)); |
| 531 } | 528 } |
| 532 | 529 |
| 533 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( | 530 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( |
| 534 bool fallback) { | 531 bool fallback) { |
| 535 blink::WebGraphicsContext3D::Attributes attrs; | 532 blink::WebGraphicsContext3D::Attributes attrs; |
| 536 attrs.shareResources = true; | 533 attrs.shareResources = true; |
| 537 attrs.noAutomaticFlushes = true; | 534 attrs.noAutomaticFlushes = true; |
| 538 | 535 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 | 584 |
| 588 void CompositorImpl::DidCommit() { | 585 void CompositorImpl::DidCommit() { |
| 589 root_window_->OnCompositingDidCommit(); | 586 root_window_->OnCompositingDidCommit(); |
| 590 } | 587 } |
| 591 | 588 |
| 592 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { | 589 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { |
| 593 root_layer_->AddChild(layer); | 590 root_layer_->AddChild(layer); |
| 594 } | 591 } |
| 595 | 592 |
| 596 } // namespace content | 593 } // namespace content |
| OLD | NEW |