| 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 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 return; | 639 return; |
| 640 | 640 |
| 641 InitializeDisplay(std::move(display_output_surface), | 641 InitializeDisplay(std::move(display_output_surface), |
| 642 std::move(vulkan_context_provider), nullptr); | 642 std::move(vulkan_context_provider), nullptr); |
| 643 } | 643 } |
| 644 #endif | 644 #endif |
| 645 | 645 |
| 646 void CompositorImpl::OnGpuChannelEstablished( | 646 void CompositorImpl::OnGpuChannelEstablished( |
| 647 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 647 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
| 648 ui::ContextProviderFactory::GpuChannelHostResult result) { | 648 ui::ContextProviderFactory::GpuChannelHostResult result) { |
| 649 DCHECK(output_surface_request_pending_); | 649 // We might end up queing multiple GpuChannel requests for the same |
| 650 // OutputSurface request as the visibility of the compositor changes, so the |
| 651 // OutputSurface request could have been handled already. |
| 652 if (!output_surface_request_pending_) |
| 653 return; |
| 650 | 654 |
| 651 switch (result) { | 655 switch (result) { |
| 652 // Don't retry if we are shutting down. | 656 // Don't retry if we are shutting down. |
| 653 case ui::ContextProviderFactory::GpuChannelHostResult:: | 657 case ui::ContextProviderFactory::GpuChannelHostResult:: |
| 654 FAILURE_FACTORY_SHUTDOWN: | 658 FAILURE_FACTORY_SHUTDOWN: |
| 655 break; | 659 break; |
| 656 case ui::ContextProviderFactory::GpuChannelHostResult:: | 660 case ui::ContextProviderFactory::GpuChannelHostResult:: |
| 657 FAILURE_GPU_PROCESS_INITIALIZATION_FAILED: | 661 FAILURE_GPU_PROCESS_INITIALIZATION_FAILED: |
| 658 // TODO(khushalsagar): Retry or have a fallback path after | 662 // TODO(khushalsagar): Retry or have a fallback path after |
| 659 // crbug.com/643282 is resolved. | 663 // crbug.com/643282 is resolved. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 | 816 |
| 813 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 817 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
| 814 host_->SetNeedsAnimate(); | 818 host_->SetNeedsAnimate(); |
| 815 } | 819 } |
| 816 | 820 |
| 817 bool CompositorImpl::HavePendingReadbacks() { | 821 bool CompositorImpl::HavePendingReadbacks() { |
| 818 return !readback_layer_tree_->children().empty(); | 822 return !readback_layer_tree_->children().empty(); |
| 819 } | 823 } |
| 820 | 824 |
| 821 } // namespace content | 825 } // namespace content |
| OLD | NEW |