Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2898583002: color: Fix color not being reset between layout tests (Closed)
Patch Set: Review feedbakc Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
1358 return gfx::ColorSpace::CreateSRGB(); 1359 // The pending tree will have the most recently updated color space, so
1359 return sync_tree()->raster_color_space(); 1360 // prefer that.
1361 if (pending_tree_)
1362 result = pending_tree_->raster_color_space();
1363 else if (active_tree_)
1364 result = active_tree_->raster_color_space();
1365
1366 // Always specify a color space if color correct rasterization is requested
1367 // (not specifying a color space indicates that no color conversion is
1368 // required).
1369 if (!result.IsValid())
1370 result = gfx::ColorSpace::CreateSRGB();
1371 return result;
1360 } 1372 }
1361 1373
1362 void LayerTreeHostImpl::RequestImplSideInvalidation() { 1374 void LayerTreeHostImpl::RequestImplSideInvalidation() {
1363 client_->NeedsImplSideInvalidation(); 1375 client_->NeedsImplSideInvalidation();
1364 } 1376 }
1365 1377
1366 void LayerTreeHostImpl::NotifyReadyToActivate() { 1378 void LayerTreeHostImpl::NotifyReadyToActivate() {
1367 client_->NotifyReadyToActivate(); 1379 client_->NotifyReadyToActivate();
1368 } 1380 }
1369 1381
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 4365
4354 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { 4366 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) {
4355 if (!element_id) 4367 if (!element_id)
4356 return; 4368 return;
4357 if (ScrollbarAnimationController* animation_controller = 4369 if (ScrollbarAnimationController* animation_controller =
4358 ScrollbarAnimationControllerForElementId(element_id)) 4370 ScrollbarAnimationControllerForElementId(element_id))
4359 animation_controller->DidScrollUpdate(); 4371 animation_controller->DidScrollUpdate();
4360 } 4372 }
4361 4373
4362 } // namespace cc 4374 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698