| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 | 1317 |
| 1318 void LayerTreeHostImpl::SetIsLikelyToRequireADraw( | 1318 void LayerTreeHostImpl::SetIsLikelyToRequireADraw( |
| 1319 bool is_likely_to_require_a_draw) { | 1319 bool is_likely_to_require_a_draw) { |
| 1320 // Proactively tell the scheduler that we expect to draw within each vsync | 1320 // Proactively tell the scheduler that we expect to draw within each vsync |
| 1321 // until we get all the tiles ready to draw. If we happen to miss a required | 1321 // until we get all the tiles ready to draw. If we happen to miss a required |
| 1322 // for draw tile here, then we will miss telling the scheduler each frame that | 1322 // for draw tile here, then we will miss telling the scheduler each frame that |
| 1323 // we intend to draw so it may make worse scheduling decisions. | 1323 // we intend to draw so it may make worse scheduling decisions. |
| 1324 is_likely_to_require_a_draw_ = is_likely_to_require_a_draw; | 1324 is_likely_to_require_a_draw_ = is_likely_to_require_a_draw; |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 gfx::ColorSpace LayerTreeHostImpl::GetTileColorSpace() const { |
| 1328 if (!sync_tree()) |
| 1329 return gfx::ColorSpace(); |
| 1330 return sync_tree()->device_color_space(); |
| 1331 } |
| 1332 |
| 1327 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1333 void LayerTreeHostImpl::NotifyReadyToActivate() { |
| 1328 client_->NotifyReadyToActivate(); | 1334 client_->NotifyReadyToActivate(); |
| 1329 } | 1335 } |
| 1330 | 1336 |
| 1331 void LayerTreeHostImpl::NotifyReadyToDraw() { | 1337 void LayerTreeHostImpl::NotifyReadyToDraw() { |
| 1332 // Tiles that are ready will cause NotifyTileStateChanged() to be called so we | 1338 // Tiles that are ready will cause NotifyTileStateChanged() to be called so we |
| 1333 // don't need to schedule a draw here. Just stop WillBeginImplFrame() from | 1339 // don't need to schedule a draw here. Just stop WillBeginImplFrame() from |
| 1334 // causing optimistic requests to draw a frame. | 1340 // causing optimistic requests to draw a frame. |
| 1335 is_likely_to_require_a_draw_ = false; | 1341 is_likely_to_require_a_draw_ = false; |
| 1336 | 1342 |
| (...skipping 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4201 if (is_visible) { | 4207 if (is_visible) { |
| 4202 worker_context_visibility_ = | 4208 worker_context_visibility_ = |
| 4203 worker_context->CacheController()->ClientBecameVisible(); | 4209 worker_context->CacheController()->ClientBecameVisible(); |
| 4204 } else { | 4210 } else { |
| 4205 worker_context->CacheController()->ClientBecameNotVisible( | 4211 worker_context->CacheController()->ClientBecameNotVisible( |
| 4206 std::move(worker_context_visibility_)); | 4212 std::move(worker_context_visibility_)); |
| 4207 } | 4213 } |
| 4208 } | 4214 } |
| 4209 | 4215 |
| 4210 } // namespace cc | 4216 } // namespace cc |
| OLD | NEW |