| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 return; | 718 return; |
| 719 | 719 |
| 720 DCHECK(window_); | 720 DCHECK(window_); |
| 721 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle); | 721 DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle); |
| 722 constexpr bool support_locking = false; | 722 constexpr bool support_locking = false; |
| 723 constexpr bool automatic_flushes = false; | 723 constexpr bool automatic_flushes = false; |
| 724 ui::ContextProviderCommandBuffer* shared_context = nullptr; | 724 ui::ContextProviderCommandBuffer* shared_context = nullptr; |
| 725 scoped_refptr<ui::ContextProviderCommandBuffer> context_provider = | 725 scoped_refptr<ui::ContextProviderCommandBuffer> context_provider = |
| 726 new ui::ContextProviderCommandBuffer( | 726 new ui::ContextProviderCommandBuffer( |
| 727 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, | 727 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
| 728 gpu::GpuStreamPriority::NORMAL, surface_handle_, | 728 gpu::GpuStreamPriority::REAL_TIME, surface_handle_, |
| 729 GURL(std::string("chrome://gpu/CompositorImpl::") + | 729 GURL(std::string("chrome://gpu/CompositorImpl::") + |
| 730 std::string("CompositorContextProvider")), | 730 std::string("CompositorContextProvider")), |
| 731 automatic_flushes, support_locking, | 731 automatic_flushes, support_locking, |
| 732 GetCompositorContextSharedMemoryLimits(root_window_), | 732 GetCompositorContextSharedMemoryLimits(root_window_), |
| 733 GetCompositorContextAttributes(has_transparent_background_), | 733 GetCompositorContextAttributes(has_transparent_background_), |
| 734 shared_context, | 734 shared_context, |
| 735 ui::command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); | 735 ui::command_buffer_metrics::DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); |
| 736 if (!context_provider->BindToCurrentThread()) { | 736 if (!context_provider->BindToCurrentThread()) { |
| 737 LOG(ERROR) << "Failed to init ContextProvider for compositor."; | 737 LOG(ERROR) << "Failed to init ContextProvider for compositor."; |
| 738 LOG_IF(FATAL, ++num_successive_context_creation_failures_ >= 2) | 738 LOG_IF(FATAL, ++num_successive_context_creation_failures_ >= 2) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 } | 873 } |
| 874 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 874 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
| 875 frame_sink_id); | 875 frame_sink_id); |
| 876 } | 876 } |
| 877 | 877 |
| 878 bool CompositorImpl::HavePendingReadbacks() { | 878 bool CompositorImpl::HavePendingReadbacks() { |
| 879 return !readback_layer_tree_->children().empty(); | 879 return !readback_layer_tree_->children().empty(); |
| 880 } | 880 } |
| 881 | 881 |
| 882 } // namespace content | 882 } // namespace content |
| OLD | NEW |