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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 896c994a1cc1b314fe4eea239d3590674b5cbaae..ce654574d98ece3e980b0914e75b7340db0eb76b 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1352,11 +1352,23 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
}
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace() const {
+ gfx::ColorSpace result;
if (!settings_.enable_color_correct_rasterization)
- return gfx::ColorSpace();
- if (!sync_tree())
- return gfx::ColorSpace::CreateSRGB();
- return sync_tree()->raster_color_space();
+ return result;
+
+ // The pending tree will have the most recently updated color space, so
+ // prefer that.
+ if (pending_tree_)
+ result = pending_tree_->raster_color_space();
+ else if (active_tree_)
+ result = active_tree_->raster_color_space();
+
+ // Always specify a color space if color correct rasterization is requested
+ // (not specifying a color space indicates that no color conversion is
+ // required).
+ if (!result.IsValid())
+ result = gfx::ColorSpace::CreateSRGB();
+ return result;
}
void LayerTreeHostImpl::RequestImplSideInvalidation() {
« 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