| Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| index 05fc565f04bfc5cc77cfeccef5166c84a748d180..3d47b2baf004e5a866f9abc911916bc5d05db7c3 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| @@ -5,6 +5,8 @@
|
| #include "core/paint/PaintLayerPainter.h"
|
|
|
| #include "core/frame/FrameView.h"
|
| +#include "core/frame/LocalFrame.h"
|
| +#include "core/frame/Settings.h"
|
| #include "core/layout/LayoutView.h"
|
| #include "core/paint/ClipPathClipper.h"
|
| #include "core/paint/FilterPainter.h"
|
| @@ -29,6 +31,21 @@
|
|
|
| namespace blink {
|
|
|
| +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;
|
| +}
|
| +
|
| static inline bool ShouldSuppressPaintingLayer(const PaintLayer& layer) {
|
| // Avoid painting descendants of the root layer when stylesheets haven't
|
| // loaded. This avoids some FOUC. It's ok not to draw, because later on, when
|
| @@ -273,6 +290,13 @@ PaintResult PaintLayerPainter::PaintLayerContents(
|
| if (paint_layer_.GetLayoutObject().GetFrameView()->ShouldThrottleRendering())
|
| return result;
|
|
|
| + HighContrastSettings high_contrast_settings =
|
| + InitHighContrastSettingsFromSettings(paint_layer_.GetLayoutObject()
|
| + .GetFrameView()
|
| + ->GetFrame()
|
| + .GetSettings());
|
| + context.SetHighContrast(high_contrast_settings);
|
| +
|
| Optional<ScopedPaintChunkProperties> scoped_paint_chunk_properties;
|
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
|
| RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
|
|
|