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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 return; | 707 return; |
708 | 708 |
709 DCHECK(window_); | 709 DCHECK(window_); |
710 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle); | 710 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle); |
711 constexpr bool support_locking = false; | 711 constexpr bool support_locking = false; |
712 constexpr bool automatic_flushes = false; | 712 constexpr bool automatic_flushes = false; |
713 ui::ContextProviderCommandBuffer* shared_context = nullptr; | 713 ui::ContextProviderCommandBuffer* shared_context = nullptr; |
714 scoped_refptr<ui::ContextProviderCommandBuffer> context_provider = | 714 scoped_refptr<ui::ContextProviderCommandBuffer> context_provider = |
715 new ui::ContextProviderCommandBuffer( | 715 new ui::ContextProviderCommandBuffer( |
716 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, | 716 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
717 gpu::GpuStreamPriority::NORMAL, surface_handle_, | 717 gpu::GpuStreamPriority::REAL_TIME, surface_handle_, |
718 GURL(std::string("chrome://gpu/CompositorImpl::") + | 718 GURL(std::string("chrome://gpu/CompositorImpl::") + |
719 std::string("CompositorContextProvider")), | 719 std::string("CompositorContextProvider")), |
720 automatic_flushes, support_locking, | 720 automatic_flushes, support_locking, |
721 GetCompositorContextSharedMemoryLimits(root_window_), | 721 GetCompositorContextSharedMemoryLimits(root_window_), |
722 GetCompositorContextAttributes(has_transparent_background_), | 722 GetCompositorContextAttributes(has_transparent_background_), |
723 shared_context, | 723 shared_context, |
724 ui::command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); | 724 ui::command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); |
725 if (!context_provider->BindToCurrentThread()) { | 725 if (!context_provider->BindToCurrentThread()) { |
726 LOG(ERROR) << "Failed to init ContextProvider for compositor."; | 726 LOG(ERROR) << "Failed to init ContextProvider for compositor."; |
727 LOG_IF(FATAL, ++num_successive_context_creation_failures_ >= 2) | 727 LOG_IF(FATAL, ++num_successive_context_creation_failures_ >= 2) |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 } | 862 } |
863 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 863 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
864 frame_sink_id); | 864 frame_sink_id); |
865 } | 865 } |
866 | 866 |
867 bool CompositorImpl::HavePendingReadbacks() { | 867 bool CompositorImpl::HavePendingReadbacks() { |
868 return !readback_layer_tree_->children().empty(); | 868 return !readback_layer_tree_->children().empty(); |
869 } | 869 } |
870 | 870 |
871 } // namespace content | 871 } // namespace content |
OLD | NEW |