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