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

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

Issue 2878573003: Initial skeleton of high-contrast mode. (Closed)
Patch Set: Rebase 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/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..5c0725af86024766eff50bb9122dfce5b7db81b4 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/HighContrastSettings.h"
#include "platform/graphics/ImageOrientation.h"
#include "platform/graphics/paint/PaintRecord.h"
#include "platform/graphics/paint/PaintRecorder.h"
@@ -82,6 +83,10 @@ class PLATFORM_EXPORT GraphicsContext {
bool ContextDisabled() const { return disabled_state_; }
+ const HighContrastSettings& high_contrast_settings() {
+ return high_contrast_settings_;
+ }
+
// ---------- State management methods -----------------
void Save();
void Restore();
@@ -90,6 +95,8 @@ class PLATFORM_EXPORT GraphicsContext {
unsigned SaveCount() const;
#endif
+ void SetHighContrast(const HighContrastSettings&);
+
float StrokeThickness() const {
return ImmutableState()->GetStrokeData().Thickness();
}
@@ -431,6 +438,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 +471,9 @@ class PLATFORM_EXPORT GraphicsContext {
float device_scale_factor_;
+ HighContrastSettings high_contrast_settings_;
+ sk_sp<SkColorFilter> high_contrast_filter_;
+
unsigned printing_ : 1;
unsigned has_meta_data_ : 1;
};
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698