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() { |