| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // These limits are meant to hold the uploads for the browser UI without | 564 // These limits are meant to hold the uploads for the browser UI without |
| 565 // any excess space. | 565 // any excess space. |
| 566 limits.start_transfer_buffer_size = 64 * 1024; | 566 limits.start_transfer_buffer_size = 64 * 1024; |
| 567 limits.min_transfer_buffer_size = 64 * 1024; | 567 limits.min_transfer_buffer_size = 64 * 1024; |
| 568 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; | 568 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; |
| 569 // Texture uploads may use mapped memory so give a reasonable limit for them. | 569 // Texture uploads may use mapped memory so give a reasonable limit for them. |
| 570 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; | 570 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; |
| 571 | 571 |
| 572 scoped_refptr<ContextProviderCommandBuffer> context_provider( | 572 scoped_refptr<ContextProviderCommandBuffer> context_provider( |
| 573 new ContextProviderCommandBuffer( | 573 new ContextProviderCommandBuffer( |
| 574 base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( | 574 std::move(gpu_channel_host), surface_handle_, url, |
| 575 surface_handle_, url, gpu_channel_host.get(), | 575 gfx::PreferIntegratedGpu, automatic_flushes, limits, attributes, |
| 576 gfx::PreferIntegratedGpu, automatic_flushes)), | 576 nullptr, |
| 577 limits, attributes, nullptr, | |
| 578 command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT)); | 577 command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT)); |
| 579 DCHECK(context_provider.get()); | 578 DCHECK(context_provider.get()); |
| 580 | 579 |
| 581 std::unique_ptr<cc::OutputSurface> real_output_surface( | 580 std::unique_ptr<cc::OutputSurface> real_output_surface( |
| 582 new OutputSurfaceWithoutParent( | 581 new OutputSurfaceWithoutParent( |
| 583 this, context_provider, | 582 this, context_provider, |
| 584 base::Bind(&CompositorImpl::PopulateGpuCapabilities, | 583 base::Bind(&CompositorImpl::PopulateGpuCapabilities, |
| 585 base::Unretained(this)), | 584 base::Unretained(this)), |
| 586 base::WrapUnique(new ExternalBeginFrameSource(this)))); | 585 base::WrapUnique(new ExternalBeginFrameSource(this)))); |
| 587 | 586 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 void CompositorImpl::SetNeedsAnimate() { | 680 void CompositorImpl::SetNeedsAnimate() { |
| 682 needs_animate_ = true; | 681 needs_animate_ = true; |
| 683 if (!host_->visible()) | 682 if (!host_->visible()) |
| 684 return; | 683 return; |
| 685 | 684 |
| 686 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 685 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
| 687 host_->SetNeedsAnimate(); | 686 host_->SetNeedsAnimate(); |
| 688 } | 687 } |
| 689 | 688 |
| 690 } // namespace content | 689 } // namespace content |
| OLD | NEW |