Mac: Fix bugs in Sierra color fix

The previous fix uncondiontally replaced populated the solid color
IOSurface and updated the contents_rect for all layers on Sierra,
instead of just doing it for the ones without IOSurfaces.

Fix this bug, parameterize whether or not we are using this workaround,
and add tests for both code paths.


Cr-Commit-Position: refs/heads/master@{#422281}
(cherry picked from commit 496c26b5cc3983f40b65729d8fa8bbd4a9951c71)

Mac: Fix Sierra solid color layer color-mismatch

Sierra treats the color correction of IOSurface-backed layers and solid
color layers differently. To ensure that behavior is consistent, do not
use solid color layers, rather, in such cases, use an 16x16 IOSurface
that is initialized to the solid color.


Cr-Commit-Position: refs/heads/master@{#421899}
(cherry picked from commit 318395caaf3a43683a41d09e65050649d5fedf27)

Review URL: .

Cr-Commit-Position: refs/branch-heads/2840@{#630}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}
4 files changed