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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2878573003: Initial skeleton of high-contrast mode. (Closed)
Patch Set: Move to CompositedLayerMapping::DoPaintTask and add unit test Created 3 years, 6 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
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index bea0b2b92a1e6ba000bf830e3065c3c771a8d571..c49bd9ed01e1bfcfa996680912ff2d572cc8b1dc 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -162,6 +162,21 @@ static inline bool IsAcceleratedContents(LayoutObject& layout_object) {
layout_object.IsVideo();
}
+static HighContrastSettings InitHighContrastSettingsFromSettings(
+ Settings* settings) {
+ HighContrastSettings result;
+ if (settings) {
+ result.mode = settings->GetHighContrastMode();
+ result.grayscale = settings->GetHighContrastGrayscale();
+ result.contrast = settings->GetHighContrastContrast();
+ } else {
+ result.mode = HighContrastMode::kOff;
+ result.grayscale = false;
+ result.contrast = 0.0;
+ }
+ return result;
+}
+
CompositedLayerMapping::CompositedLayerMapping(PaintLayer& layer)
: owning_layer_(layer),
content_offset_in_compositing_layer_dirty_(false),
@@ -3089,6 +3104,11 @@ void CompositedLayerMapping::DoPaintTask(
paint_info.paint_layer->GetLayoutObject().GetFrame());
context.SetDeviceScaleFactor(device_scale_factor);
+ HighContrastSettings high_contrast_settings =
+ InitHighContrastSettingsFromSettings(
+ GetLayoutObject().GetFrame()->GetSettings());
chrishtr 2017/06/05 16:35:18 Can GetSettings ever return nullptr? If not then p
dmazzoni 2017/06/06 05:23:24 Looks like there's no way it can return nullptr, s
+ context.SetHighContrast(high_contrast_settings);
+
if (paint_info.paint_layer->GetCompositingState() !=
kPaintsIntoGroupedBacking) {
// FIXME: GraphicsLayers need a way to split for multicol.

Powered by Google App Engine
This is Rietveld 408576698