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 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1345 void LayerTreeHostImpl::SetIsLikelyToRequireADraw( | 1345 void LayerTreeHostImpl::SetIsLikelyToRequireADraw( |
1346 bool is_likely_to_require_a_draw) { | 1346 bool is_likely_to_require_a_draw) { |
1347 // Proactively tell the scheduler that we expect to draw within each vsync | 1347 // Proactively tell the scheduler that we expect to draw within each vsync |
1348 // until we get all the tiles ready to draw. If we happen to miss a required | 1348 // until we get all the tiles ready to draw. If we happen to miss a required |
1349 // for draw tile here, then we will miss telling the scheduler each frame that | 1349 // for draw tile here, then we will miss telling the scheduler each frame that |
1350 // we intend to draw so it may make worse scheduling decisions. | 1350 // we intend to draw so it may make worse scheduling decisions. |
1351 is_likely_to_require_a_draw_ = is_likely_to_require_a_draw; | 1351 is_likely_to_require_a_draw_ = is_likely_to_require_a_draw; |
1352 } | 1352 } |
1353 | 1353 |
1354 gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace() const { | 1354 gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace() const { |
1355 gfx::ColorSpace result; | |
1355 if (!settings_.enable_color_correct_rasterization) | 1356 if (!settings_.enable_color_correct_rasterization) |
1356 return gfx::ColorSpace(); | 1357 return result; |
1357 if (!sync_tree()) | 1358 if (sync_tree()) |
1358 return gfx::ColorSpace::CreateSRGB(); | 1359 result = sync_tree()->raster_color_space(); |
enne (OOO)
2017/05/20 03:32:21
I realize you're not changing this here, but this
ccameron
2017/05/22 23:27:08
Oh, LTHI::sync_tree() returns
return pending_tre
enne (OOO)
2017/05/23 00:13:43
Ok, you're correct that as written, sync tree will
ccameron
2017/05/23 06:28:39
Yeah, this doesn't have guarantees about when it w
| |
1359 return sync_tree()->raster_color_space(); | 1360 if (!result.IsValid()) |
1361 result = gfx::ColorSpace::CreateSRGB(); | |
1362 return result; | |
1360 } | 1363 } |
1361 | 1364 |
1362 void LayerTreeHostImpl::RequestImplSideInvalidation() { | 1365 void LayerTreeHostImpl::RequestImplSideInvalidation() { |
1363 client_->NeedsImplSideInvalidation(); | 1366 client_->NeedsImplSideInvalidation(); |
1364 } | 1367 } |
1365 | 1368 |
1366 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1369 void LayerTreeHostImpl::NotifyReadyToActivate() { |
1367 client_->NotifyReadyToActivate(); | 1370 client_->NotifyReadyToActivate(); |
1368 } | 1371 } |
1369 | 1372 |
(...skipping 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4348 | 4351 |
4349 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { | 4352 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { |
4350 if (!element_id) | 4353 if (!element_id) |
4351 return; | 4354 return; |
4352 if (ScrollbarAnimationController* animation_controller = | 4355 if (ScrollbarAnimationController* animation_controller = |
4353 ScrollbarAnimationControllerForElementId(element_id)) | 4356 ScrollbarAnimationControllerForElementId(element_id)) |
4354 animation_controller->DidScrollUpdate(); | 4357 animation_controller->DidScrollUpdate(); |
4355 } | 4358 } |
4356 | 4359 |
4357 } // namespace cc | 4360 } // namespace cc |
OLD | NEW |