RESOLVED FIXED 230913
Allow `DrawGlyphsRecorder` to be used with any `GraphicsContext` instead of just `DisplayList::Recorder`
https://bugs.webkit.org/show_bug.cgi?id=230913
Summary Allow `DrawGlyphsRecorder` to be used with any `GraphicsContext` instead of j...
Devin Rousso
Reported 2021-09-28 14:02:34 PDT
there's really nothing about `DrawGlyphsRecorder` that's specific to display lists other than it only being used by `DisplayList::Recorder`
Attachments
Patch (14.67 KB, patch)
2021-09-28 15:19 PDT, Devin Rousso
no flags
Patch (15.22 KB, patch)
2021-09-28 16:32 PDT, Devin Rousso
no flags
Patch (15.22 KB, patch)
2021-09-29 14:52 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2021-09-28 15:19:40 PDT
Myles C. Maxfield
Comment 2 2021-09-28 15:23:35 PDT
Comment on attachment 439530 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439530&action=review > Source/WebCore/platform/graphics/GraphicsContext.h:358 > + virtual const GraphicsContextState& lastStateChange() const { return state(); } Still don't like the word "change" > Source/WebCore/platform/graphics/GraphicsContext.h:477 > + drawGlyphs(font, glyphs, advances, numGlyphs, point, fontSmoothingMode); If all the arguments are identical, why doesn't DrawGlyphsRecorder just call drawGlyphs() instead of this renamed function? > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:153 > +const GraphicsContextState& Recorder::lastStateChange() const ditto > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:97 > + const GraphicsContextState& lastStateChange() const final; ditto.
Devin Rousso
Comment 3 2021-09-28 15:34:32 PDT
Comment on attachment 439530 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439530&action=review >> Source/WebCore/platform/graphics/GraphicsContext.h:358 >> + virtual const GraphicsContextState& lastStateChange() const { return state(); } > > Still don't like the word "change" Do you have any suggestions as to a different name? Alternatively, do you know why `m_owner.currentState().stateChange.m_state` was written the way it was originally? Perhaps if I understand that then I can come up with a better name :) >> Source/WebCore/platform/graphics/GraphicsContext.h:477 >> + drawGlyphs(font, glyphs, advances, numGlyphs, point, fontSmoothingMode); > > If all the arguments are identical, why doesn't DrawGlyphsRecorder just call drawGlyphs() instead of this renamed function? `drawGlyphs` is what calls into `DrawGlyphsRecorder`, which then calls into `drawGlyphsAndCacheFont` (which `DisplayList::Recorder` overrides to append a `DrawGlyphs` display list item) Also FWIW this code already existed before. I just moved it from being only on `DisplayList::Recorder` to also being on `GraphicsContext`. Currently the only caller of `DrawGlyphsRecorder::drawGlyphs` is `DisplayList::Recorder::drawGlyphs`, meaning that we need some other method that `DrawGlyphsRecorder` can call once it's done its work to pass it back to the `DisplayList::Recorder`. I'm open to other naming ideas if you have any suggestions :)
Devin Rousso
Comment 4 2021-09-28 16:32:47 PDT
Wenson Hsieh
Comment 5 2021-09-28 17:14:52 PDT
Comment on attachment 439542 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439542&action=review > Source/WebCore/ChangeLog:41 > + for the `state` "getter" so that `DrawGlypsRecorder` is able to access the current state in Nit - DrawGlypsRecorder
Devin Rousso
Comment 6 2021-09-29 14:52:02 PDT
Created attachment 439664 [details] Patch fix typo in ChangeLog
EWS
Comment 7 2021-09-29 16:04:59 PDT
Committed r283273 (242302@main): <https://commits.webkit.org/242302@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 439664 [details].
Radar WebKit Bug Importer
Comment 8 2021-09-29 16:05:27 PDT
Note You need to log in before you can comment on or make changes to this bug.