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

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

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/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..a4023859c594bcfbc9bac328012defd7505d7c1b 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"
@@ -70,6 +71,7 @@ class PLATFORM_EXPORT GraphicsContext {
};
explicit GraphicsContext(PaintController&,
+ const HighContrastSettings* = nullptr,
chrishtr 2017/06/05 16:35:18 Hmm. It seems that the constructor is not used at
dmazzoni 2017/06/06 05:23:24 Done.
DisabledMode = kNothingDisabled,
SkMetaData* = 0);
@@ -82,6 +84,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 +96,8 @@ class PLATFORM_EXPORT GraphicsContext {
unsigned SaveCount() const;
#endif
+ void SetHighContrast(const HighContrastSettings&);
+
float StrokeThickness() const {
return ImmutableState()->GetStrokeData().Thickness();
}
@@ -431,6 +439,10 @@ class PLATFORM_EXPORT GraphicsContext {
const SkMetaData& MetaData() const { return meta_data_; }
+ void UpdateHighContrastFilterFromSettings();
+ 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 +473,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;
};

Powered by Google App Engine
This is Rietveld 408576698