TextRun does not do a very good job of bit packing. Since most of the time this is an auto var, no big deal, but for SVG it is a member var of SVGTextMetricsBuilder, and thus RenderSVGText. It also is a member var in
Created attachment 140440 [details] Patch
Comment on attachment 140440 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140440&action=review > Source/WebCore/platform/graphics/TextRun.h:170 > + ExpansionBehavior m_expansionBehavior : 2; bitfield enums will fail on MSVC (since they're signed). > Source/WebCore/platform/graphics/TextRun.h:172 > + TextDirection m_direction : 1; Similar problem.
Also, if we're going to shrink the size of this, we should keep it small with a COMPILE_ASSERT.
Created attachment 140442 [details] Patch
Comment on attachment 140442 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140442&action=review > Source/WebCore/platform/graphics/TextRun.h:170 > + ExpansionBehavior m_expansionBehavior : 2; Same problem as before. MSVC will make the enum signed, and thus you'll have one fewer bit than you think you do. :) I thought we had helper macros for this?
Hi Eric, (In reply to comment #5) > (From update of attachment 140442 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=140442&action=review > > > Source/WebCore/platform/graphics/TextRun.h:170 > > + ExpansionBehavior m_expansionBehavior : 2; > > Same problem as before. MSVC will make the enum signed, and thus you'll have one fewer bit than you think you do. :) I thought we had helper macros for this? It is an unsigned in disguise! typedef unsigned ExpansionBehavior;
Comment on attachment 140442 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140442&action=review Can we add some compile time assertions to check if this is packed right, like we normally do in cases like this? >>> Source/WebCore/platform/graphics/TextRun.h:170 >>> + ExpansionBehavior m_expansionBehavior : 2; >> >> Same problem as before. MSVC will make the enum signed, and thus you'll have one fewer bit than you think you do. :) I thought we had helper macros for this? > > It is an unsigned in disguise! > > typedef unsigned ExpansionBehavior; Why not be explicit about it, given the likelihood of confusion?
Hi Darin, (In reply to comment #7) > (From update of attachment 140442 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=140442&action=review > > Can we add some compile time assertions to check if this is packed right, like we normally do in cases like this? Good idea, did that before landing. > >>> Source/WebCore/platform/graphics/TextRun.h:170 > >>> + ExpansionBehavior m_expansionBehavior : 2; > >> > >> Same problem as before. MSVC will make the enum signed, and thus you'll have one fewer bit than you think you do. :) I thought we had helper macros for this? > > > > It is an unsigned in disguise! > > > > typedef unsigned ExpansionBehavior; > > Why not be explicit about it, given the likelihood of confusion? I tried but unfortunately this would mean changing a lot of files that use this ExpansionBehavior. Let me know if you want a follow-up bug for that. Cheers, Rob.
Build fix for r116260 landed in r116262.
(In reply to comment #9) > Build fix for r116260 landed in r116262. Thanks!
Landed in r116260.