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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.h

Issue 2878573003: Initial skeleton of high-contrast mode. (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.h
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
index a0cf6f35e5efda023d03f65bc894da2727b277a2..c05c556467b406a0acd2e7af371b93f40e9e4a97 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
@@ -34,6 +34,7 @@
#include "platform/graphics/DashArray.h"
#include "platform/graphics/DrawLooperBuilder.h"
#include "platform/graphics/GraphicsContextState.h"
+#include "platform/graphics/HighContrast.h"
#include "platform/graphics/ImageOrientation.h"
#include "platform/graphics/paint/PaintRecord.h"
#include "platform/graphics/paint/PaintRecorder.h"
@@ -90,6 +91,8 @@ class PLATFORM_EXPORT GraphicsContext {
unsigned SaveCount() const;
#endif
+ void SetHighContrast(const HighContrastSettings&);
+
float StrokeThickness() const {
return ImmutableState()->GetStrokeData().Thickness();
}
@@ -431,6 +434,9 @@ class PLATFORM_EXPORT GraphicsContext {
const SkMetaData& MetaData() const { return meta_data_; }
+ Color ApplyHighContrastFilter(const Color& input) const;
+ PaintFlags ApplyHighContrastFilter(const PaintFlags* input) const;
+
// null indicates painting is contextDisabled. Never delete this object.
PaintCanvas* canvas_;
@@ -461,6 +467,8 @@ class PLATFORM_EXPORT GraphicsContext {
float device_scale_factor_;
+ sk_sp<SkColorFilter> high_contrast_filter_;
+
unsigned printing_ : 1;
unsigned has_meta_data_ : 1;
};

Powered by Google App Engine
This is Rietveld 408576698