OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 | 1117 |
1118 void RenderWidgetCompositor::RequestNewCompositorFrameSink() { | 1118 void RenderWidgetCompositor::RequestNewCompositorFrameSink() { |
1119 // If the host is closing, then no more compositing is possible. This | 1119 // If the host is closing, then no more compositing is possible. This |
1120 // prevents shutdown races between handling the close message and | 1120 // prevents shutdown races between handling the close message and |
1121 // the CreateCompositorFrameSink task. | 1121 // the CreateCompositorFrameSink task. |
1122 if (delegate_->IsClosing()) | 1122 if (delegate_->IsClosing()) |
1123 return; | 1123 return; |
1124 | 1124 |
1125 bool fallback = num_failed_recreate_attempts_ >= | 1125 bool fallback = num_failed_recreate_attempts_ >= |
1126 COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK; | 1126 COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK; |
| 1127 |
| 1128 #ifdef OS_ANDROID |
| 1129 LOG_IF(FATAL, fallback) << "Android does not support fallback frame sinks."; |
| 1130 #endif |
| 1131 |
1127 delegate_->RequestNewCompositorFrameSink( | 1132 delegate_->RequestNewCompositorFrameSink( |
1128 fallback, base::Bind(&RenderWidgetCompositor::SetCompositorFrameSink, | 1133 fallback, base::Bind(&RenderWidgetCompositor::SetCompositorFrameSink, |
1129 weak_factory_.GetWeakPtr())); | 1134 weak_factory_.GetWeakPtr())); |
1130 } | 1135 } |
1131 | 1136 |
1132 void RenderWidgetCompositor::DidInitializeCompositorFrameSink() { | 1137 void RenderWidgetCompositor::DidInitializeCompositorFrameSink() { |
1133 num_failed_recreate_attempts_ = 0; | 1138 num_failed_recreate_attempts_ = 0; |
1134 } | 1139 } |
1135 | 1140 |
1136 void RenderWidgetCompositor::DidFailToInitializeCompositorFrameSink() { | 1141 void RenderWidgetCompositor::DidFailToInitializeCompositorFrameSink() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 const cc::LocalSurfaceId& local_surface_id) { | 1212 const cc::LocalSurfaceId& local_surface_id) { |
1208 layer_tree_host_->SetLocalSurfaceId(local_surface_id); | 1213 layer_tree_host_->SetLocalSurfaceId(local_surface_id); |
1209 } | 1214 } |
1210 | 1215 |
1211 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { | 1216 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { |
1212 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( | 1217 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( |
1213 std::move(callback), base::ThreadTaskRunnerHandle::Get())); | 1218 std::move(callback), base::ThreadTaskRunnerHandle::Get())); |
1214 } | 1219 } |
1215 | 1220 |
1216 } // namespace content | 1221 } // namespace content |
OLD | NEW |