RESOLVED FIXED 92901
[chromium] Move compositor HUD font atlas generation out of compositor core
https://bugs.webkit.org/show_bug.cgi?id=92901
Summary [chromium] Move compositor HUD font atlas generation out of compositor core
James Robinson
Reported 2012-08-01 12:49:30 PDT
[chromium] Move compositor HUD font atlas generation out of compositor core
Attachments
Patch (20.49 KB, patch)
2012-08-01 12:51 PDT, James Robinson
enne: review+
James Robinson
Comment 1 2012-08-01 12:51:14 PDT
Adrienne Walker
Comment 2 2012-08-01 13:28:53 PDT
Comment on attachment 155864 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155864&action=review R=me, with some drive-by cleanup comments on code you're moving around. > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:43 > +#define FONT_HEIGHT 14 Unused? > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:59 > + fontHeight = 14; > + > + OwnPtr<SkCanvas> canvas = adoptPtr(skia::CreateBitmapCanvas(ATLAS_SIZE, ATLAS_SIZE, false /* opaque */)); This baked in font height and atlas size is kind of a mess, but it's not your fault.
Shawn Singh
Comment 3 2012-08-01 13:48:03 PDT
(In reply to comment #2) > (From update of attachment 155864 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=155864&action=review > > R=me, with some drive-by cleanup comments on code you're moving around. > > > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:43 > > +#define FONT_HEIGHT 14 > > Unused? > > > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:59 > > + fontHeight = 14; > > + > > + OwnPtr<SkCanvas> canvas = adoptPtr(skia::CreateBitmapCanvas(ATLAS_SIZE, ATLAS_SIZE, false /* opaque */)); > > This baked in font height and atlas size is kind of a mess, but it's not your fault. Ouch... that was clearly directed at me. =( At the time I coded this, we didn't (and we still don't, i think?) care about how flexible and powerful the HUD code was. So I opted to make those variables into private macros so that they should be easy to make into run-time args that are given to the font atlas when we really want to. As long as we also handle the error of when the font size cannot fully fit into the desired atlas size. Feel free to make a bug on me if you had some reason for us to refactor it.
James Robinson
Comment 4 2012-08-01 15:19:45 PDT
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 155864 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=155864&action=review > > > > R=me, with some drive-by cleanup comments on code you're moving around. > > > > > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:43 > > > +#define FONT_HEIGHT 14 > > > > Unused? Will remove, thanks for catching it. > > > > > Source/WebCore/platform/graphics/chromium/CompositorHUDFontAtlas.cpp:59 > > > + fontHeight = 14; > > > + > > > + OwnPtr<SkCanvas> canvas = adoptPtr(skia::CreateBitmapCanvas(ATLAS_SIZE, ATLAS_SIZE, false /* opaque */)); > > > > This baked in font height and atlas size is kind of a mess, but it's not your fault. > > Ouch... that was clearly directed at me. =( > > At the time I coded this, we didn't (and we still don't, i think?) care about how flexible and powerful the HUD code was. So I opted to make those variables into private macros so that they should be easy to make into run-time args that are given to the font atlas when we really want to. As long as we also handle the error of when the font size cannot fully fit into the desired atlas size. > > Feel free to make a bug on me if you had some reason for us to refactor it. I don't think any action is required, it's good enough for what we need.
James Robinson
Comment 5 2012-08-01 15:26:40 PDT
Note You need to log in before you can comment on or make changes to this bug.