Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2386643004: content: Handle OutputSurface requests correctly. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 return; 640 return;
641 641
642 InitializeDisplay(std::move(display_output_surface), 642 InitializeDisplay(std::move(display_output_surface),
643 std::move(vulkan_context_provider), nullptr); 643 std::move(vulkan_context_provider), nullptr);
644 } 644 }
645 #endif 645 #endif
646 646
647 void CompositorImpl::OnGpuChannelEstablished( 647 void CompositorImpl::OnGpuChannelEstablished(
648 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, 648 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
649 ui::ContextProviderFactory::GpuChannelHostResult result) { 649 ui::ContextProviderFactory::GpuChannelHostResult result) {
650 DCHECK(output_surface_request_pending_); 650 // We might end up queing multiple GpuChannel requests for the same
651 // OutputSurface request as the visibility of the compositor changes, so the
652 // OutputSurface request could have been handled already.
653 if (!output_surface_request_pending_)
654 return;
651 655
652 switch (result) { 656 switch (result) {
653 // Don't retry if we are shutting down. 657 // Don't retry if we are shutting down.
654 case ui::ContextProviderFactory::GpuChannelHostResult:: 658 case ui::ContextProviderFactory::GpuChannelHostResult::
655 FAILURE_FACTORY_SHUTDOWN: 659 FAILURE_FACTORY_SHUTDOWN:
656 break; 660 break;
657 case ui::ContextProviderFactory::GpuChannelHostResult:: 661 case ui::ContextProviderFactory::GpuChannelHostResult::
658 FAILURE_GPU_PROCESS_INITIALIZATION_FAILED: 662 FAILURE_GPU_PROCESS_INITIALIZATION_FAILED:
659 HandlePendingOutputSurfaceRequest(); 663 HandlePendingOutputSurfaceRequest();
660 break; 664 break;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698