Bug 128056

Summary: Subpixel rendering: LayoutUnit operator++ is broken.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jonlee, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 127524, 128036    
Attachments:
Description Flags
Patch
none
Patch none

Description zalan 2014-02-01 19:06:59 PST
It defines post-increment only and implements it as if it was pre-increment.
Comment 1 zalan 2014-02-01 19:27:46 PST
Created attachment 222899 [details]
Patch
Comment 2 Darin Adler 2014-02-01 21:17:05 PST
Comment on attachment 222899 [details]
Patch

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

> Source/WebCore/platform/LayoutUnit.h:197
> -    LayoutUnit operator++(int)
> +    LayoutUnit& operator++()
>      {
>          m_value += kEffectiveFixedPointDenominator;
>          return *this;
>      }

Great fix!

> Source/WebCore/platform/LayoutUnit.h:204
> +    LayoutUnit operator++(int)
> +    {
> +        LayoutUnit result = *this;
> +        ++(*this);
> +        return result;
> +    }

Not sure we really need to add this, although I suppose it does little harm.

On a separate note, if it was me I would have written ++*this without parentheses.
Comment 3 zalan 2014-02-01 21:20:46 PST
(In reply to comment #2)
> (From update of attachment 222899 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222899&action=review
> 
> > Source/WebCore/platform/LayoutUnit.h:197
> > -    LayoutUnit operator++(int)
> > +    LayoutUnit& operator++()
> >      {
> >          m_value += kEffectiveFixedPointDenominator;
> >          return *this;
> >      }
> 
> Great fix!
> 
> > Source/WebCore/platform/LayoutUnit.h:204
> > +    LayoutUnit operator++(int)
> > +    {
> > +        LayoutUnit result = *this;
> > +        ++(*this);
> > +        return result;
> > +    }
> 
> Not sure we really need to add this, although I suppose it does little harm.
Indeed! I guess we can add it back when it is actually needed. I'll land this without the post increment. Thanks!
Comment 4 zalan 2014-02-01 21:40:48 PST
Created attachment 222907 [details]
Patch
Comment 5 zalan 2014-02-01 21:41:12 PST
Comment on attachment 222907 [details]
Patch

EWS testing
Comment 6 WebKit Commit Bot 2014-02-01 23:40:47 PST
Comment on attachment 222907 [details]
Patch

Clearing flags on attachment: 222907

Committed r163260: <http://trac.webkit.org/changeset/163260>
Comment 7 WebKit Commit Bot 2014-02-01 23:40:49 PST
All reviewed patches have been landed.  Closing bug.