Bug 121180 - [Windows] Avoid converting from IntSize->SIZE->IntSize
Summary: [Windows] Avoid converting from IntSize->SIZE->IntSize
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Minor
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-09-11 14:07 PDT by Brent Fulgham
Modified: 2013-09-11 15:16 PDT (History)
1 user (show)

See Also:


Attachments
Patch (12.12 KB, patch)
2013-09-11 14:43 PDT, Brent Fulgham
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-09-11 14:07:53 PDT
There are several code paths where a WebKit IntSize is converted to a Microsoft SIZE struct, only to be changed back to an IntSize for further work.

Instead, revise the API to take an IntSize argument so we don't have to do this wasted conversion. The only counter-case is in the IconDatabase, where we will have to convert a SIZE to an IntSize to accommodate this change. However, this "extra copy" code path is much less frequent than the other cases, which are used for cursor handling and the copy/paste buffer.
Comment 1 Brent Fulgham 2013-09-11 14:43:30 PDT
Created attachment 211353 [details]
Patch
Comment 2 Anders Carlsson 2013-09-11 14:56:59 PDT
Comment on attachment 211353 [details]
Patch

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

> Source/WebCore/platform/graphics/BitmapImage.h:153
> +    virtual bool getHBITMAPOfSize(HBITMAP, const IntSize*);

I think this should take a const IntSize.

> Source/WebCore/platform/graphics/Image.h:164
> +    virtual bool getHBITMAPOfSize(HBITMAP, const IntSize*) { return false; }

Ditto. And use override.
Comment 3 Brent Fulgham 2013-09-11 15:06:47 PDT
Comment on attachment 211353 [details]
Patch

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

>> Source/WebCore/platform/graphics/BitmapImage.h:153
>> +    virtual bool getHBITMAPOfSize(HBITMAP, const IntSize*);
> 
> I think this should take a const IntSize.

I can't. The argument is optional, and the implementations take different code paths if an argument is supplied.

>> Source/WebCore/platform/graphics/Image.h:164
>> +    virtual bool getHBITMAPOfSize(HBITMAP, const IntSize*) { return false; }
> 
> Ditto. And use override.

Ditto for me, too. But I will change to use the OVERRIDE macro.
Comment 4 Radar WebKit Bug Importer 2013-09-11 15:15:57 PDT
<rdar://problem/14969413>
Comment 5 Brent Fulgham 2013-09-11 15:16:48 PDT
Committed r155570: <http://trac.webkit.org/changeset/155570>