[webkit-reviews] review granted: [Bug 225377] ImageBuffer with floating point logicalSize() paints into a slightly truncated destination rect : [Attachment 427720] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 6 14:17:45 PDT 2021


Said Abou-Hallawa <sabouhallawa at apple.com> has granted Tim Horton
<thorton at apple.com>'s request for review:
Bug 225377: ImageBuffer with floating point logicalSize() paints into a
slightly truncated destination rect
https://bugs.webkit.org/show_bug.cgi?id=225377

Attachment 427720: Patch

https://bugs.webkit.org/attachment.cgi?id=427720&action=review




--- Comment #7 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Comment on attachment 427720
  --> https://bugs.webkit.org/attachment.cgi?id=427720
Patch

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

>>>>> Source/WebCore/platform/graphics/ImageBuffer.h:87
>>>>> +    virtual IntSize truncatedLogicalSize() const = 0;
>>>> 
>>>> Can't we use a different name instead of prefixing an existing one? I have
this suggestion:
>>>> 
>>>> FloatSize logicalSize(); // The size in the client coordinates
>>>> IntSize imageSize();     // The size in logical pixels
>>>> IntSize backendSize();   // The size in physical (or device) pixels.
>>> 
>>> I don't think so. The "truncated-" was there sort of in the spirit of
"deprecated-": as a message that you're probably doing something wrong. Your
name doesn't give me the uneasy feeling that I was going for :)
>> 
>> "deprecated-"? I think we need both. When you deal with the ImageBuffer
internally, e.g. getImageData() and putImageData(), you need the IntSize. And
when you draw the ImageBuffer itself in the client context you need the
FloatSize. So I do not think we can get it rid of the IntSize.
> 
> Maybe the few callers who rightfully need truncation do it themselves? I'm
not sure :)
> 
> It's definitely wrong *most* of the time, so having something attractively
named "imageSize" that does the *mostly wrong* thing is bad, right?

Okay I think this is fine. Maybe later we can remove truncatedLogicalSize() and
let the callers does the conversion from FloatSize to IntSize.


More information about the webkit-reviews mailing list