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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 // These limits are meant to hold the uploads for the browser UI without | 535 // These limits are meant to hold the uploads for the browser UI without |
536 // any excess space. | 536 // any excess space. |
537 limits.start_transfer_buffer_size = 64 * 1024; | 537 limits.start_transfer_buffer_size = 64 * 1024; |
538 limits.min_transfer_buffer_size = 64 * 1024; | 538 limits.min_transfer_buffer_size = 64 * 1024; |
539 constexpr size_t kBytesPerPixel = 4; | 539 constexpr size_t kBytesPerPixel = 4; |
540 const size_t full_screen_texture_size_in_bytes = | 540 const size_t full_screen_texture_size_in_bytes = |
541 gfx::DeviceDisplayInfo().GetDisplayHeight() * | 541 gfx::DeviceDisplayInfo().GetDisplayHeight() * |
542 gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel; | 542 gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel; |
543 limits.max_transfer_buffer_size = std::min( | 543 limits.max_transfer_buffer_size = std::min( |
544 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); | 544 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); |
545 // TODO(danakj): This limit should be on the GLHelper context instead in | |
546 // RWHVAndroid since that is where we do the async readback and map gpu | |
547 // memory to do so. | |
548 limits.mapped_memory_reclaim_limit = 2 * 1024 * 1024; | |
no sievers
2016/04/20 23:41:47
I'm wondering if we should still leave some limit
danakj
2016/04/20 23:45:37
Sure what limit would you like?
| |
549 | 545 |
550 scoped_refptr<ContextProviderCommandBuffer> context_provider( | 546 scoped_refptr<ContextProviderCommandBuffer> context_provider( |
551 new ContextProviderCommandBuffer( | 547 new ContextProviderCommandBuffer( |
552 base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( | 548 base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( |
553 surface_handle, url, gpu_channel_host.get(), attributes, | 549 surface_handle, url, gpu_channel_host.get(), attributes, |
554 gfx::PreferIntegratedGpu, share_resources, automatic_flushes, | 550 gfx::PreferIntegratedGpu, share_resources, automatic_flushes, |
555 nullptr)), | 551 nullptr)), |
556 limits, DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT)); | 552 limits, DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT)); |
557 DCHECK(context_provider.get()); | 553 DCHECK(context_provider.get()); |
558 | 554 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 | 652 |
657 void CompositorImpl::SetNeedsAnimate() { | 653 void CompositorImpl::SetNeedsAnimate() { |
658 needs_animate_ = true; | 654 needs_animate_ = true; |
659 if (!host_->visible()) | 655 if (!host_->visible()) |
660 return; | 656 return; |
661 | 657 |
662 host_->SetNeedsAnimate(); | 658 host_->SetNeedsAnimate(); |
663 } | 659 } |
664 | 660 |
665 } // namespace content | 661 } // namespace content |
OLD | NEW |