Changeset 245754 in webkit
- Timestamp:
- May 24, 2019, 2:47:32 PM (7 years ago)
- Location:
- branches/safari-608.1.24.20-branch/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/GraphicsContext.cpp (modified) (5 diffs)
-
platform/graphics/GraphicsContext.h (modified) (3 diffs)
-
rendering/TextPaintStyle.cpp (modified) (3 diffs)
-
rendering/TextPaintStyle.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog
r245743 r245754 1 2019-05-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r245752. rdar://problem/51068494 4 5 Plumb dark appearance down to GraphicsContext. 6 https://bugs.webkit.org/show_bug.cgi?id=198224 7 rdar://problem/51068494 8 9 Reviewed by Dean Jackson. 10 11 No test yet, as it is not testable until this gets used. 12 13 * platform/graphics/GraphicsContext.cpp: 14 (WebCore::GraphicsContextStateChange::changesFromState const): 15 (WebCore::GraphicsContextStateChange::accumulate): 16 (WebCore::GraphicsContextStateChange::apply const): 17 (WebCore::GraphicsContextStateChange::dump const): 18 (WebCore::GraphicsContext::setUseDarkAppearance): 19 * platform/graphics/GraphicsContext.h: 20 (WebCore::GraphicsContext::useDarkAppearance const): 21 * rendering/TextPaintStyle.cpp: 22 (WebCore::TextPaintStyle::operator== const): 23 (WebCore::computeTextPaintStyle): 24 (WebCore::updateGraphicsContext): 25 * rendering/TextPaintStyle.h: 26 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245752 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2019-05-24 Timothy Hatcher <timothy@apple.com> 31 32 Plumb dark appearance down to GraphicsContext. 33 https://bugs.webkit.org/show_bug.cgi?id=198224 34 rdar://problem/51068494 35 36 Reviewed by Dean Jackson. 37 38 No test yet, as it is not testable until this gets used. 39 40 * platform/graphics/GraphicsContext.cpp: 41 (WebCore::GraphicsContextStateChange::changesFromState const): 42 (WebCore::GraphicsContextStateChange::accumulate): 43 (WebCore::GraphicsContextStateChange::apply const): 44 (WebCore::GraphicsContextStateChange::dump const): 45 (WebCore::GraphicsContext::setUseDarkAppearance): 46 * platform/graphics/GraphicsContext.h: 47 (WebCore::GraphicsContext::useDarkAppearance const): 48 * rendering/TextPaintStyle.cpp: 49 (WebCore::TextPaintStyle::operator== const): 50 (WebCore::computeTextPaintStyle): 51 (WebCore::updateGraphicsContext): 52 * rendering/TextPaintStyle.h: 53 1 54 2019-05-23 Babak Shafiei <bshafiei@apple.com> 2 55 -
branches/safari-608.1.24.20-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp
r243163 r245754 110 110 CHECK_FOR_CHANGED_PROPERTY(ImageInterpolationQualityChange, imageInterpolationQuality); 111 111 112 #if HAVE(OS_DARK_MODE_SUPPORT) 113 CHECK_FOR_CHANGED_PROPERTY(UseDarkAppearanceChange, useDarkAppearance); 114 #endif 115 112 116 return changeFlags; 113 117 } … … 178 182 if (flags & GraphicsContextState::ImageInterpolationQualityChange) 179 183 m_state.imageInterpolationQuality = state.imageInterpolationQuality; 180 184 185 #if HAVE(OS_DARK_MODE_SUPPORT) 186 if (flags & GraphicsContextState::UseDarkAppearanceChange) 187 m_state.useDarkAppearance = state.useDarkAppearance; 188 #endif 189 181 190 m_changeFlags |= flags; 182 191 } … … 246 255 if (m_changeFlags & GraphicsContextState::ImageInterpolationQualityChange) 247 256 context.setImageInterpolationQuality(m_state.imageInterpolationQuality); 257 258 #if HAVE(OS_DARK_MODE_SUPPORT) 259 if (m_changeFlags & GraphicsContextState::UseDarkAppearanceChange) 260 context.setUseDarkAppearance(m_state.useDarkAppearance); 261 #endif 248 262 } 249 263 … … 313 327 if (m_changeFlags & GraphicsContextState::DrawLuminanceMaskChange) 314 328 ts.dumpProperty("draw-luminance-mask", m_state.drawLuminanceMask); 329 330 #if HAVE(OS_DARK_MODE_SUPPORT) 331 if (m_changeFlags & GraphicsContextState::UseDarkAppearanceChange) 332 ts.dumpProperty("use-dark-appearance", m_state.useDarkAppearance); 333 #endif 315 334 } 316 335 … … 939 958 m_impl->updateState(m_state, GraphicsContextState::DrawLuminanceMaskChange); 940 959 } 960 961 #if HAVE(OS_DARK_MODE_SUPPORT) 962 void GraphicsContext::setUseDarkAppearance(bool useDarkAppearance) 963 { 964 m_state.useDarkAppearance = useDarkAppearance; 965 if (m_impl) 966 m_impl->updateState(m_state, GraphicsContextState::UseDarkAppearanceChange); 967 } 968 #endif 941 969 942 970 #if !USE(CG) && !USE(DIRECT2D) -
branches/safari-608.1.24.20-branch/Source/WebCore/platform/graphics/GraphicsContext.h
r241271 r245754 164 164 DrawLuminanceMaskChange = 1 << 20, 165 165 ImageInterpolationQualityChange = 1 << 21, 166 #if HAVE(OS_DARK_MODE_SUPPORT) 167 UseDarkAppearanceChange = 1 << 22, 168 #endif 166 169 }; 167 170 typedef uint32_t StateChangeFlags; … … 200 203 #endif 201 204 bool drawLuminanceMask : 1; 205 #if HAVE(OS_DARK_MODE_SUPPORT) 206 bool useDarkAppearance : 1; 207 #endif 202 208 }; 203 209 … … 410 416 void setTextDrawingMode(TextDrawingModeFlags); 411 417 TextDrawingModeFlags textDrawingMode() const { return m_state.textDrawingMode; } 418 419 #if HAVE(OS_DARK_MODE_SUPPORT) 420 void setUseDarkAppearance(bool); 421 bool useDarkAppearance() const { return m_state.useDarkAppearance; } 422 #endif 412 423 413 424 float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = WTF::nullopt); -
branches/safari-608.1.24.20-branch/Source/WebCore/rendering/TextPaintStyle.cpp
r239427 r245754 53 53 && useLetterpressEffect == other.useLetterpressEffect 54 54 #endif 55 #if HAVE(OS_DARK_MODE_SUPPORT) 56 && useDarkAppearance == other.useDarkAppearance 57 #endif 55 58 && lineCap == other.lineCap && miterLimit == other.miterLimit; 56 59 } … … 82 85 paintStyle.useLetterpressEffect = lineStyle.textDecorationsInEffect().contains(TextDecoration::Letterpress); 83 86 #endif 87 88 #if HAVE(OS_DARK_MODE_SUPPORT) 89 paintStyle.useDarkAppearance = frame.document() ? frame.document()->useDarkAppearance(&lineStyle) : false; 90 #endif 91 84 92 auto viewportSize = frame.view() ? frame.view()->size() : IntSize(); 85 93 paintStyle.strokeWidth = lineStyle.computedStrokeWidth(viewportSize); … … 187 195 } 188 196 197 #if HAVE(OS_DARK_MODE_SUPPORT) 198 context.setUseDarkAppearance(paintStyle.useDarkAppearance); 199 #endif 200 189 201 Color fillColor = fillColorType == UseEmphasisMarkColor ? paintStyle.emphasisMarkColor : paintStyle.fillColor; 190 202 if (mode & TextModeFill && (fillColor != context.fillColor())) -
branches/safari-608.1.24.20-branch/Source/WebCore/rendering/TextPaintStyle.h
r239427 r245754 53 53 bool useLetterpressEffect { false }; 54 54 #endif 55 #if HAVE(OS_DARK_MODE_SUPPORT) 56 bool useDarkAppearance { false }; 57 #endif 55 58 PaintOrder paintOrder { PaintOrder::Normal }; 56 59 LineJoin lineJoin { MiterJoin };
Note:
See TracChangeset
for help on using the changeset viewer.