Bug 121180

Summary: [Windows] Avoid converting from IntSize->SIZE->IntSize
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Minor CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Patch andersca: review+

Brent Fulgham
Reported 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.
Attachments
Patch (12.12 KB, patch)
2013-09-11 14:43 PDT, Brent Fulgham
andersca: review+
Brent Fulgham
Comment 1 2013-09-11 14:43:30 PDT
Anders Carlsson
Comment 2 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.
Brent Fulgham
Comment 3 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.
Radar WebKit Bug Importer
Comment 4 2013-09-11 15:15:57 PDT
Brent Fulgham
Comment 5 2013-09-11 15:16:48 PDT
Note You need to log in before you can comment on or make changes to this bug.