Changeset 194708 in webkit
- Timestamp:
- Jan 7, 2016, 11:53:31 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r194691 r194708 71 71 "${WEBCORE_DIR}/platform/graphics/cpu/arm" 72 72 "${WEBCORE_DIR}/platform/graphics/cpu/arm/filters" 73 "${WEBCORE_DIR}/platform/graphics/displaylists" 73 74 "${WEBCORE_DIR}/platform/graphics/filters" 74 75 "${WEBCORE_DIR}/platform/graphics/filters/texmap" … … 2216 2217 platform/graphics/cpu/arm/filters/FELightingNEON.cpp 2217 2218 2219 platform/graphics/displaylists/DisplayList.cpp 2220 platform/graphics/displaylists/DisplayListItems.cpp 2221 platform/graphics/displaylists/DisplayListRecorder.cpp 2222 platform/graphics/displaylists/DisplayListReplayer.cpp 2223 2218 2224 platform/graphics/filters/DistantLightSource.cpp 2219 2225 platform/graphics/filters/FEBlend.cpp -
trunk/Source/WebCore/ChangeLog
r194706 r194708 1 2016-01-06 Simon Fraser <simon.fraser@apple.com> 2 3 Initial implementation files for display-list recording and playback 4 https://bugs.webkit.org/show_bug.cgi?id=152816 5 6 Reviewed by Zalan Bujtas. 7 8 Add files for: 9 - DisplayList, a class that holds a vector of display items, and in the future will hold metadata 10 on the list for optimizations etc. 11 - DisplayList::Recorder, the outward-facing recording API which GraphicsContext will 12 call into. 13 - DisplayList::Replayer, which plays back a DisplayList, possibly applying optimizations. 14 - Various DisplayList::Items, one type for each display list operation. They cover most of the 15 GraphicsContext functionality, other than clipping to an image buffer. Text drawing is stubbed 16 out for now. 17 18 Added a "DisplayLists" log channel. 19 20 Added GraphicsContextState functions for tracking state deltas with change bits. It may 21 make sense to combine GraphicsContextStateChange and GraphicsContextState, and use the 22 dirty bits in non-display-list drawing as well. 23 24 * CMakeLists.txt: 25 * WebCore.xcodeproj/project.pbxproj: 26 * platform/Logging.h: 27 * platform/graphics/GraphicsContext.h: 28 * platform/graphics/displaylists/DisplayList.cpp: Added. 29 (WebCore::DisplayList::DisplayList::description): 30 (WebCore::DisplayList::DisplayList::dump): 31 (WebCore::operator<<): 32 * platform/graphics/displaylists/DisplayListItems.cpp: Added. 33 * platform/graphics/displaylists/DisplayListItems.h: Added. 34 * platform/graphics/displaylists/DisplayListRecorder.cpp: Added. 35 * platform/graphics/displaylists/DisplayListRecorder.h: Added. 36 * platform/graphics/displaylists/DisplayListReplayer.cpp: Added. 37 (WebCore::DisplayList::Replayer::Replayer): 38 (WebCore::DisplayList::Replayer::~Replayer): 39 (WebCore::DisplayList::Replayer::replay): 40 * platform/graphics/displaylists/DisplayListReplayer.h: Added. 41 1 42 2016-01-07 Chris Dumez <cdumez@apple.com> 2 43 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r194691 r194708 551 551 0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */; }; 552 552 0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */; }; 553 0FE5FBD21C3DD51E0007A2CA /* DisplayList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5FBCA1C3DD51E0007A2CA /* DisplayList.cpp */; }; 554 0FE5FBD31C3DD51E0007A2CA /* DisplayList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5FBCB1C3DD51E0007A2CA /* DisplayList.h */; }; 555 0FE5FBD41C3DD51E0007A2CA /* DisplayListItems.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5FBCC1C3DD51E0007A2CA /* DisplayListItems.cpp */; }; 556 0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5FBCD1C3DD51E0007A2CA /* DisplayListItems.h */; }; 557 0FE5FBD61C3DD51E0007A2CA /* DisplayListRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5FBCE1C3DD51E0007A2CA /* DisplayListRecorder.cpp */; }; 558 0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5FBCF1C3DD51E0007A2CA /* DisplayListRecorder.h */; }; 559 0FE5FBD81C3DD51E0007A2CA /* DisplayListReplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5FBD01C3DD51E0007A2CA /* DisplayListReplayer.cpp */; }; 560 0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5FBD11C3DD51E0007A2CA /* DisplayListReplayer.h */; }; 553 561 0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */; }; 554 562 0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */; }; … … 7840 7848 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeMac.cpp; sourceTree = "<group>"; }; 7841 7849 0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeMac.h; sourceTree = "<group>"; }; 7850 0FE5FBCA1C3DD51E0007A2CA /* DisplayList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayList.cpp; path = displaylists/DisplayList.cpp; sourceTree = "<group>"; }; 7851 0FE5FBCB1C3DD51E0007A2CA /* DisplayList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DisplayList.h; path = displaylists/DisplayList.h; sourceTree = "<group>"; }; 7852 0FE5FBCC1C3DD51E0007A2CA /* DisplayListItems.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayListItems.cpp; path = displaylists/DisplayListItems.cpp; sourceTree = "<group>"; }; 7853 0FE5FBCD1C3DD51E0007A2CA /* DisplayListItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DisplayListItems.h; path = displaylists/DisplayListItems.h; sourceTree = "<group>"; }; 7854 0FE5FBCE1C3DD51E0007A2CA /* DisplayListRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayListRecorder.cpp; path = displaylists/DisplayListRecorder.cpp; sourceTree = "<group>"; }; 7855 0FE5FBCF1C3DD51E0007A2CA /* DisplayListRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DisplayListRecorder.h; path = displaylists/DisplayListRecorder.h; sourceTree = "<group>"; }; 7856 0FE5FBD01C3DD51E0007A2CA /* DisplayListReplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayListReplayer.cpp; path = displaylists/DisplayListReplayer.cpp; sourceTree = "<group>"; }; 7857 0FE5FBD11C3DD51E0007A2CA /* DisplayListReplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DisplayListReplayer.h; path = displaylists/DisplayListReplayer.h; sourceTree = "<group>"; }; 7842 7858 0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeMock.cpp; sourceTree = "<group>"; }; 7843 7859 0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMock.h; sourceTree = "<group>"; }; … … 15655 15671 sourceTree = "<group>"; 15656 15672 }; 15673 0FE5FBC91C3DD5060007A2CA /* displaylists */ = { 15674 isa = PBXGroup; 15675 children = ( 15676 0FE5FBCA1C3DD51E0007A2CA /* DisplayList.cpp */, 15677 0FE5FBCB1C3DD51E0007A2CA /* DisplayList.h */, 15678 0FE5FBCC1C3DD51E0007A2CA /* DisplayListItems.cpp */, 15679 0FE5FBCD1C3DD51E0007A2CA /* DisplayListItems.h */, 15680 0FE5FBCE1C3DD51E0007A2CA /* DisplayListRecorder.cpp */, 15681 0FE5FBCF1C3DD51E0007A2CA /* DisplayListRecorder.h */, 15682 0FE5FBD01C3DD51E0007A2CA /* DisplayListReplayer.cpp */, 15683 0FE5FBD11C3DD51E0007A2CA /* DisplayListReplayer.h */, 15684 ); 15685 name = displaylists; 15686 sourceTree = "<group>"; 15687 }; 15657 15688 14DFB33F0A7DF7630018F769 /* Derived Sources */ = { 15658 15689 isa = PBXGroup; … … 21530 21561 B5320D68122A24E9002D1440 /* cocoa */, 21531 21562 9332AB3B16515D7700D827EC /* cpu */, 21563 0FE5FBC91C3DD5060007A2CA /* displaylists */, 21532 21564 A75E8B7F0E1DE2B0007F2481 /* filters */, 21533 21565 498770C11242C50D002226BA /* gpu */, … … 25069 25101 FDAF19991513D131008DB0C3 /* DirectConvolver.h in Headers */, 25070 25102 7EDAAFC919A2CCDC0034DFD1 /* DiskCacheMonitorCocoa.h in Headers */, 25103 0FE5FBD31C3DD51E0007A2CA /* DisplayList.h in Headers */, 25104 0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */, 25105 0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */, 25106 0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */, 25071 25107 49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */, 25072 25108 2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */, … … 28903 28939 FDAF19981513D131008DB0C3 /* DirectConvolver.cpp in Sources */, 28904 28940 7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */, 28941 0FE5FBD21C3DD51E0007A2CA /* DisplayList.cpp in Sources */, 28942 0FE5FBD41C3DD51E0007A2CA /* DisplayListItems.cpp in Sources */, 28943 0FE5FBD61C3DD51E0007A2CA /* DisplayListRecorder.cpp in Sources */, 28944 0FE5FBD81C3DD51E0007A2CA /* DisplayListReplayer.cpp in Sources */, 28905 28945 49FC7A501444AF5F00A5D864 /* DisplayRefreshMonitor.cpp in Sources */, 28906 28946 2D29ECC5192ECC8300984B78 /* DisplayRefreshMonitorClient.cpp in Sources */, -
trunk/Source/WebCore/platform/Logging.h
r194405 r194708 49 49 M(Compositing) \ 50 50 M(ContentFiltering) \ 51 M(DisplayLists) \ 51 52 M(DOMTimers) \ 52 53 M(Editing) \ -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r194630 r194708 35 35 #include "RoundedRect.h" 36 36 #include "TextRun.h" 37 #include "TextStream.h" 37 38 38 39 namespace WebCore { … … 98 99 bool m_interpolationQualityChanged; 99 100 }; 101 102 103 #define CHECK_FOR_CHANGED_PROPERTY(flag, property) \ 104 if ((m_changeFlags & GraphicsContextState::flag) && (m_state.property != state.property)) \ 105 changeFlags |= GraphicsContextState::flag; 106 107 GraphicsContextState::StateChangeFlags GraphicsContextStateChange::changesFromState(const GraphicsContextState& state) const 108 { 109 GraphicsContextState::StateChangeFlags changeFlags = GraphicsContextState::NoChange; 110 111 CHECK_FOR_CHANGED_PROPERTY(StrokeGradientChange, strokeGradient); 112 CHECK_FOR_CHANGED_PROPERTY(StrokePatternChange, strokePattern); 113 CHECK_FOR_CHANGED_PROPERTY(FillGradientChange, fillGradient); 114 CHECK_FOR_CHANGED_PROPERTY(FillPatternChange, fillPattern); 115 116 if ((m_changeFlags & GraphicsContextState::ShadowChange) 117 && (m_state.shadowOffset != state.shadowOffset 118 || m_state.shadowBlur != state.shadowBlur 119 || m_state.shadowColor != state.shadowColor)) 120 changeFlags |= GraphicsContextState::ShadowChange; 121 122 CHECK_FOR_CHANGED_PROPERTY(StrokeThicknessChange, strokeThickness); 123 CHECK_FOR_CHANGED_PROPERTY(TextDrawingModeChange, textDrawingMode); 124 CHECK_FOR_CHANGED_PROPERTY(StrokeColorChange, strokeColor); 125 CHECK_FOR_CHANGED_PROPERTY(FillColorChange, fillColor); 126 CHECK_FOR_CHANGED_PROPERTY(StrokeStyleChange, strokeStyle); 127 CHECK_FOR_CHANGED_PROPERTY(FillRuleChange, fillRule); 128 CHECK_FOR_CHANGED_PROPERTY(AlphaChange, alpha); 129 130 if ((m_changeFlags & (GraphicsContextState::CompositeOperationChange | GraphicsContextState::BlendModeChange)) 131 && (m_state.compositeOperator != state.compositeOperator || m_state.blendMode != state.blendMode)) 132 changeFlags |= (GraphicsContextState::CompositeOperationChange | GraphicsContextState::BlendModeChange); 133 134 CHECK_FOR_CHANGED_PROPERTY(ShouldAntialiasChange, shouldAntialias); 135 CHECK_FOR_CHANGED_PROPERTY(ShouldSmoothFontsChange, shouldSmoothFonts); 136 CHECK_FOR_CHANGED_PROPERTY(AntialiasedFontDilationEnabledChange, antialiasedFontDilationEnabled); 137 CHECK_FOR_CHANGED_PROPERTY(ShouldSubpixelQuantizeFontsChange, shouldSubpixelQuantizeFonts); 138 CHECK_FOR_CHANGED_PROPERTY(ShadowsIgnoreTransformsChange, shadowsIgnoreTransforms); 139 CHECK_FOR_CHANGED_PROPERTY(DrawLuminanceMaskChange, drawLuminanceMask); 140 CHECK_FOR_CHANGED_PROPERTY(ImageInterpolationQualityChange, imageInterpolationQuality); 141 142 return changeFlags; 143 } 144 145 void GraphicsContextStateChange::accumulate(const GraphicsContextState& state, GraphicsContextState::StateChangeFlags flags) 146 { 147 // FIXME: This code should move to GraphicsContextState. 148 if (flags & GraphicsContextState::StrokeGradientChange) 149 m_state.strokeGradient = state.strokeGradient; 150 151 if (flags & GraphicsContextState::StrokePatternChange) 152 m_state.strokePattern = state.strokePattern; 153 154 if (flags & GraphicsContextState::FillGradientChange) 155 m_state.fillGradient = state.fillGradient; 156 157 if (flags & GraphicsContextState::FillPatternChange) 158 m_state.fillPattern = state.fillPattern; 159 160 if (flags & GraphicsContextState::ShadowChange) { 161 // FIXME: Deal with state.shadowsUseLegacyRadius. 162 m_state.shadowOffset = state.shadowOffset; 163 m_state.shadowBlur = state.shadowBlur; 164 m_state.shadowColor = state.shadowColor; 165 } 166 167 if (flags & GraphicsContextState::StrokeThicknessChange) 168 m_state.strokeThickness = state.strokeThickness; 169 170 if (flags & GraphicsContextState::TextDrawingModeChange) 171 m_state.textDrawingMode = state.textDrawingMode; 172 173 if (flags & GraphicsContextState::StrokeColorChange) 174 m_state.strokeColor = state.strokeColor; 175 176 if (flags & GraphicsContextState::FillColorChange) 177 m_state.fillColor = state.fillColor; 178 179 if (flags & GraphicsContextState::StrokeStyleChange) 180 m_state.strokeStyle = state.strokeStyle; 181 182 if (flags & GraphicsContextState::FillRuleChange) 183 m_state.fillRule = state.fillRule; 184 185 if (flags & GraphicsContextState::AlphaChange) 186 m_state.alpha = state.alpha; 187 188 if (flags & (GraphicsContextState::CompositeOperationChange | GraphicsContextState::BlendModeChange)) { 189 m_state.compositeOperator = state.compositeOperator; 190 m_state.blendMode = state.blendMode; 191 } 192 193 if (flags & GraphicsContextState::ShouldAntialiasChange) 194 m_state.shouldAntialias = state.shouldAntialias; 195 196 if (flags & GraphicsContextState::ShouldSmoothFontsChange) 197 m_state.shouldSmoothFonts = state.shouldSmoothFonts; 198 199 if (flags & GraphicsContextState::AntialiasedFontDilationEnabledChange) 200 m_state.antialiasedFontDilationEnabled = state.antialiasedFontDilationEnabled; 201 202 if (flags & GraphicsContextState::ShouldSubpixelQuantizeFontsChange) 203 m_state.shouldSubpixelQuantizeFonts = state.shouldSubpixelQuantizeFonts; 204 205 if (flags & GraphicsContextState::ShadowsIgnoreTransformsChange) 206 m_state.shadowsIgnoreTransforms = state.shadowsIgnoreTransforms; 207 208 if (flags & GraphicsContextState::DrawLuminanceMaskChange) 209 m_state.drawLuminanceMask = state.drawLuminanceMask; 210 211 if (flags & GraphicsContextState::ImageInterpolationQualityChange) 212 m_state.imageInterpolationQuality = state.imageInterpolationQuality; 213 214 m_changeFlags |= flags; 215 } 216 217 void GraphicsContextStateChange::apply(GraphicsContext& context) const 218 { 219 if (m_changeFlags & GraphicsContextState::StrokeGradientChange) 220 context.setStrokeGradient(*m_state.strokeGradient); 221 222 if (m_changeFlags & GraphicsContextState::StrokePatternChange) 223 context.setStrokePattern(*m_state.strokePattern); 224 225 if (m_changeFlags & GraphicsContextState::FillGradientChange) 226 context.setFillGradient(*m_state.fillGradient); 227 228 if (m_changeFlags & GraphicsContextState::FillPatternChange) 229 context.setFillPattern(*m_state.fillPattern); 230 231 if (m_changeFlags & GraphicsContextState::ShadowChange) { 232 #if USE(CG) 233 if (m_state.shadowsUseLegacyRadius) 234 context.setLegacyShadow(m_state.shadowOffset, m_state.shadowBlur, m_state.shadowColor); 235 else 236 #endif 237 context.setShadow(m_state.shadowOffset, m_state.shadowBlur, m_state.shadowColor); 238 } 239 240 if (m_changeFlags & GraphicsContextState::StrokeThicknessChange) 241 context.setStrokeThickness(m_state.strokeThickness); 242 243 if (m_changeFlags & GraphicsContextState::TextDrawingModeChange) 244 context.setTextDrawingMode(m_state.textDrawingMode); 245 246 if (m_changeFlags & GraphicsContextState::StrokeColorChange) 247 context.setStrokeColor(m_state.strokeColor); 248 249 if (m_changeFlags & GraphicsContextState::FillColorChange) 250 context.setFillColor(m_state.fillColor); 251 252 if (m_changeFlags & GraphicsContextState::StrokeStyleChange) 253 context.setStrokeStyle(m_state.strokeStyle); 254 255 if (m_changeFlags & GraphicsContextState::FillRuleChange) 256 context.setFillRule(m_state.fillRule); 257 258 if (m_changeFlags & GraphicsContextState::AlphaChange) 259 context.setAlpha(m_state.alpha); 260 261 if (m_changeFlags & (GraphicsContextState::CompositeOperationChange | GraphicsContextState::BlendModeChange)) 262 context.setCompositeOperation(m_state.compositeOperator, m_state.blendMode); 263 264 if (m_changeFlags & GraphicsContextState::ShouldAntialiasChange) 265 context.setShouldAntialias(m_state.shouldAntialias); 266 267 if (m_changeFlags & GraphicsContextState::ShouldSmoothFontsChange) 268 context.setShouldSmoothFonts(m_state.shouldSmoothFonts); 269 270 if (m_changeFlags & GraphicsContextState::AntialiasedFontDilationEnabledChange) 271 context.setAntialiasedFontDilationEnabled(m_state.antialiasedFontDilationEnabled); 272 273 if (m_changeFlags & GraphicsContextState::ShouldSubpixelQuantizeFontsChange) 274 context.setShouldSubpixelQuantizeFonts(m_state.shouldSubpixelQuantizeFonts); 275 276 if (m_changeFlags & GraphicsContextState::ShadowsIgnoreTransformsChange) 277 context.setShadowsIgnoreTransforms(m_state.shadowsIgnoreTransforms); 278 279 if (m_changeFlags & GraphicsContextState::DrawLuminanceMaskChange) 280 context.setDrawLuminanceMask(m_state.drawLuminanceMask); 281 282 if (m_changeFlags & GraphicsContextState::ImageInterpolationQualityChange) 283 context.setImageInterpolationQuality(m_state.imageInterpolationQuality); 284 } 285 286 void GraphicsContextStateChange::dump(TextStream& ts) const 287 { 288 ts.dumpProperty("change-flags", m_changeFlags); 289 290 if (m_changeFlags & GraphicsContextState::StrokeGradientChange) 291 ts.dumpProperty("stroke-gradient", m_state.strokeGradient.get()); 292 293 if (m_changeFlags & GraphicsContextState::StrokePatternChange) 294 ts.dumpProperty("stroke-pattern", m_state.strokePattern.get()); 295 296 if (m_changeFlags & GraphicsContextState::FillGradientChange) 297 ts.dumpProperty("fill-gradient", m_state.fillGradient.get()); 298 299 if (m_changeFlags & GraphicsContextState::FillPatternChange) 300 ts.dumpProperty("fill-pattern", m_state.fillPattern.get()); 301 302 if (m_changeFlags & GraphicsContextState::ShadowChange) { 303 ts.dumpProperty("shadow-blur", m_state.shadowBlur); 304 ts.dumpProperty("shadow-offset", m_state.shadowOffset); 305 #if USE(CG) 306 ts.dumpProperty("shadows-use-legacy-radius", m_state.shadowsUseLegacyRadius); 307 #endif 308 } 309 310 if (m_changeFlags & GraphicsContextState::StrokeThicknessChange) 311 ts.dumpProperty("stroke-thickness", m_state.strokeThickness); 312 313 if (m_changeFlags & GraphicsContextState::TextDrawingModeChange) 314 ts.dumpProperty("text-drawing-mode", m_state.textDrawingMode); 315 316 if (m_changeFlags & GraphicsContextState::StrokeColorChange) 317 ts.dumpProperty("stroke-color", m_state.strokeColor); 318 319 if (m_changeFlags & GraphicsContextState::FillColorChange) 320 ts.dumpProperty("fill-color", m_state.fillColor); 321 322 if (m_changeFlags & GraphicsContextState::StrokeStyleChange) 323 ts.dumpProperty("stroke-style", m_state.strokeStyle); 324 325 if (m_changeFlags & GraphicsContextState::FillRuleChange) 326 ts.dumpProperty("fill-rule", m_state.fillRule); 327 328 if (m_changeFlags & GraphicsContextState::AlphaChange) 329 ts.dumpProperty("alpha", m_state.alpha); 330 331 if (m_changeFlags & GraphicsContextState::CompositeOperationChange) 332 ts.dumpProperty("composite-operator", m_state.compositeOperator); 333 334 if (m_changeFlags & GraphicsContextState::BlendModeChange) 335 ts.dumpProperty("blend-mode", m_state.blendMode); 336 337 if (m_changeFlags & GraphicsContextState::ShouldAntialiasChange) 338 ts.dumpProperty("should-antialias", m_state.shouldAntialias); 339 340 if (m_changeFlags & GraphicsContextState::ShouldSmoothFontsChange) 341 ts.dumpProperty("should-smooth-fonts", m_state.shouldSmoothFonts); 342 343 if (m_changeFlags & GraphicsContextState::AntialiasedFontDilationEnabledChange) 344 ts.dumpProperty("antialiased-font-dilation-enabled", m_state.antialiasedFontDilationEnabled); 345 346 if (m_changeFlags & GraphicsContextState::ShouldSubpixelQuantizeFontsChange) 347 ts.dumpProperty("should-subpixel-quantize-fonts", m_state.shouldSubpixelQuantizeFonts); 348 349 if (m_changeFlags & GraphicsContextState::ShadowsIgnoreTransformsChange) 350 ts.dumpProperty("shadows-ignore-transforms", m_state.shadowsIgnoreTransforms); 351 352 if (m_changeFlags & GraphicsContextState::DrawLuminanceMaskChange) 353 ts.dumpProperty("draw-luminance-mask", m_state.drawLuminanceMask); 354 } 355 356 TextStream& operator<<(TextStream& ts, const GraphicsContextStateChange& stateChange) 357 { 358 stateChange.dump(ts); 359 return ts; 360 } 361 100 362 101 363 GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext) -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r194630 r194708 128 128 } 129 129 130 enum Change : uint32_t { 131 NoChange = 0, 132 StrokeGradientChange = 1 << 1, 133 StrokePatternChange = 1 << 2, 134 FillGradientChange = 1 << 3, 135 FillPatternChange = 1 << 4, 136 StrokeThicknessChange = 1 << 5, 137 StrokeColorChange = 1 << 6, 138 StrokeStyleChange = 1 << 7, 139 FillColorChange = 1 << 8, 140 FillRuleChange = 1 << 9, 141 ShadowChange = 1 << 10, 142 ShadowColorChange = 1 << 11, 143 ShadowsIgnoreTransformsChange = 1 << 12, 144 AlphaChange = 1 << 13, 145 CompositeOperationChange = 1 << 14, 146 BlendModeChange = 1 << 15, 147 TextDrawingModeChange = 1 << 16, 148 ShouldAntialiasChange = 1 << 17, 149 ShouldSmoothFontsChange = 1 << 18, 150 AntialiasedFontDilationEnabledChange = 1 << 19, 151 ShouldSubpixelQuantizeFontsChange = 1 << 20, 152 DrawLuminanceMaskChange = 1 << 21, 153 ImageInterpolationQualityChange = 1 << 22, 154 }; 155 typedef uint32_t StateChangeFlags; 156 130 157 RefPtr<Gradient> strokeGradient; 131 158 RefPtr<Pattern> strokePattern; … … 195 222 bool m_useLowQualityScale; 196 223 }; 224 225 struct GraphicsContextStateChange { 226 GraphicsContextStateChange() = default; 227 GraphicsContextStateChange(const GraphicsContextState& state, GraphicsContextState::StateChangeFlags flags) 228 : m_state(state) 229 , m_changeFlags(flags) 230 { 231 } 232 233 GraphicsContextState::StateChangeFlags changesFromState(const GraphicsContextState&) const; 234 235 void accumulate(const GraphicsContextState&, GraphicsContextState::StateChangeFlags); 236 void apply(GraphicsContext&) const; 237 238 void dump(TextStream&) const; 239 240 GraphicsContextState m_state; 241 GraphicsContextState::StateChangeFlags m_changeFlags { GraphicsContextState::NoChange }; 242 }; 243 244 TextStream& operator<<(TextStream&, const GraphicsContextStateChange&); 245 197 246 198 247 class GraphicsContext {
Note:
See TracChangeset
for help on using the changeset viewer.