Bug 102958 - [chromium] Add WebLayerTreeViewClient API to request font atlas
Summary: [chromium] Add WebLayerTreeViewClient API to request font atlas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-21 10:10 PST by egraether
Modified: 2012-11-27 15:17 PST (History)
8 users (show)

See Also:


Attachments
Patch (4.02 KB, patch)
2012-11-21 10:13 PST, egraether
no flags Details | Formatted Diff | Diff
Patch (4.10 KB, patch)
2012-11-21 11:19 PST, egraether
no flags Details | Formatted Diff | Diff
Patch (4.15 KB, patch)
2012-11-26 12:55 PST, egraether
no flags Details | Formatted Diff | Diff
Patch (4.21 KB, patch)
2012-11-27 14:33 PST, egraether
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description egraether 2012-11-21 10:10:58 PST
[chromium] make compositor requesting the font atlas #1
Comment 1 egraether 2012-11-21 10:13:11 PST
Created attachment 175473 [details]
Patch
Comment 2 WebKit Review Bot 2012-11-21 10:16:43 PST
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 WebKit Review Bot 2012-11-21 10:36:26 PST
Comment on attachment 175473 [details]
Patch

Attachment 175473 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14960027
Comment 5 egraether 2012-11-21 11:19:17 PST
Created attachment 175486 [details]
Patch
Comment 6 egraether 2012-11-21 16:35:56 PST
(In reply to comment #3)
> commit order:
> https://bugs.webkit.org/show_bug.cgi?id=102958
> https://codereview.chromium.org/11413123
> https://bugs.webkit.org/show_bug.cgi?id=102960

jamesr, can you please hava a look at them?
Comment 7 James Robinson 2012-11-25 22:08:35 PST
Comment on attachment 175486 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=175486&action=review

> Source/Platform/ChangeLog:3
> +        [chromium] make compositor request the font atlas #1

This does not describe the patch or the bug and is grammatically iffy.  Please rephrase

> Source/Platform/chromium/public/WebLayerTreeViewClient.h:109
> +    virtual void createFontAtlas(SkBitmap&, WebRect[128], int&) { }

The third parameter isn't very clear from the signature - could you provide a descriptive name?
Comment 8 egraether 2012-11-26 10:58:23 PST
(In reply to comment #7)
> (From update of attachment 175486 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=175486&action=review
> 
> > Source/Platform/ChangeLog:3
> > +        [chromium] make compositor request the font atlas #1
> 
> This does not describe the patch or the bug and is grammatically iffy.  Please rephrase

Yeah, I found it pretty hard to find something descriptive. What would be better? 

- replace font atlas passing with requesting
- make font atlas creation accessible to WebLayerTreeView and remove font atlas passing
- replace WebLayerTreeView::setFontAtlas() with WebLayerTreeViewClient::createFontAtlas()

I tried to find one name for all three patches and number them. Is that a good idea? I need some help here please.

> > Source/Platform/chromium/public/WebLayerTreeViewClient.h:109
> > +    virtual void createFontAtlas(SkBitmap&, WebRect[128], int&) { }
> 
> The third parameter isn't very clear from the signature - could you provide a descriptive name?

I had a look at how this was done before, the second parameter was named as well. Is this better?:

virtual void createFontAtlas(SkBitmap&, WebRect asciiToRectTable[128], int& fontHeight) { }

Is there a rule of thumb of when to name parameters in interface methods?
Comment 9 James Robinson 2012-11-26 11:09:45 PST
(In reply to comment #8)
> (In reply to comment #7)
> > (From update of attachment 175486 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=175486&action=review
> > 
> > > Source/Platform/ChangeLog:3
> > > +        [chromium] make compositor request the font atlas #1
> > 
> > This does not describe the patch or the bug and is grammatically iffy.  Please rephrase
> 
> Yeah, I found it pretty hard to find something descriptive. What would be better? 
> 
> - replace font atlas passing with requesting
> - make font atlas creation accessible to WebLayerTreeView and remove font atlas passing
> - replace WebLayerTreeView::setFontAtlas() with WebLayerTreeViewClient::createFontAtlas()
> 
> I tried to find one name for all three patches and number them. Is that a good idea? I need some help here please.

That sounds like a good list to have in the ChangeLog.  For the top line, you could describe the API change this adds - for instance something like "[chromium] Add WebLayerTreeViewClient API to request font atlas" or something like that.


> 
> > > Source/Platform/chromium/public/WebLayerTreeViewClient.h:109
> > > +    virtual void createFontAtlas(SkBitmap&, WebRect[128], int&) { }
> > 
> > The third parameter isn't very clear from the signature - could you provide a descriptive name?
> 
> I had a look at how this was done before, the second parameter was named as well. Is this better?:
> 
> virtual void createFontAtlas(SkBitmap&, WebRect asciiToRectTable[128], int& fontHeight) { }

Yes

> 
> Is there a rule of thumb of when to name parameters in interface methods?

Yes - if the name of the parameter is fairly obvious from the type and signature, leave it out.  Otherwise, include it.  For instance having the first parameter be called 'bitmap' would be redundant with the type and calling it 'atlas' would be redundant with the function name, so leaving it out is fine.  See http://www.webkit.org/coding/coding-style.html#names-verb
Comment 10 egraether 2012-11-26 12:55:17 PST
Created attachment 176048 [details]
Patch
Comment 11 James Robinson 2012-11-26 13:08:53 PST
Comment on attachment 176048 [details]
Patch

Thanks, looks good.
Comment 12 WebKit Review Bot 2012-11-27 10:09:00 PST
Comment on attachment 176048 [details]
Patch

Rejecting attachment 176048 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
0 (offset -10 lines).
1 out of 2 hunks FAILED -- saving rejects to file Source/Platform/chromium/public/WebLayerTreeViewClient.h.rej
patching file Source/WebKit/chromium/src/WebViewImpl.cpp
Hunk #1 succeeded at 4203 (offset -11 lines).
patching file Source/WebKit/chromium/src/WebViewImpl.h
Hunk #1 succeeded at 324 (offset -1 lines).

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'James Robi..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue

Full output: http://queues.webkit.org/results/15018112
Comment 13 egraether 2012-11-27 14:33:37 PST
Created attachment 176341 [details]
Patch
Comment 14 WebKit Review Bot 2012-11-27 15:17:51 PST
Comment on attachment 176341 [details]
Patch

Clearing flags on attachment: 176341

Committed r135929: <http://trac.webkit.org/changeset/135929>
Comment 15 WebKit Review Bot 2012-11-27 15:17:55 PST
All reviewed patches have been landed.  Closing bug.