Bug 136253 - Subpixel layout: Remove float to LayoutUnit ceil/round function wrappers.
Summary: Subpixel layout: Remove float to LayoutUnit ceil/round function wrappers.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks: 136275
  Show dependency treegraph
 
Reported: 2014-08-26 08:25 PDT by zalan
Modified: 2014-08-26 20:16 PDT (History)
2 users (show)

See Also:


Attachments
Patch (12.50 KB, patch)
2014-08-26 10:43 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.32 KB, patch)
2014-08-26 11:16 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (8.68 KB, patch)
2014-08-26 11:43 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-08-26 08:25:28 PDT
ceiledLayoutUnit()
roundedLayoutUnit()

These functions ceil/round float to LayoutUnit. Their usage are limited and can easily be confused with the snapping functions (snap to css/device pixels).
Comment 1 zalan 2014-08-26 10:43:51 PDT
Created attachment 237156 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-08-26 10:59:28 PDT
Comment on attachment 237156 [details]
Patch

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

> Source/WebCore/platform/LayoutUnit.h:926
> +// When this occurs while accumulating converted LayoutUnit values, we can wind up with a result smaller than expected.

That doesn't explain the ceil though. This comment is pretty confusing. The caller really needs to know whether ceiling or flooring is appropriate for them.

> Source/WebCore/platform/LayoutUnit.h:927
> +inline LayoutUnit ceilFloatForSubPixelLayout(float value)

I don't think the "ForSubPixelLayout" adds anything. I think the name "ceiledLayoutUnit" is as good.
Comment 3 zalan 2014-08-26 11:16:27 PDT
Created attachment 237158 [details]
Patch
Comment 4 zalan 2014-08-26 11:43:37 PDT
Created attachment 237160 [details]
Patch
Comment 5 Simon Fraser (smfr) 2014-08-26 11:48:50 PDT
Comment on attachment 237160 [details]
Patch

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

> Source/WebCore/rendering/RenderBlock.cpp:2902
> +    preferredWidth = std::max(LayoutUnit::fromFloatCeil(result), preferredWidth);

You lost some of the comment here, which I think is useful to explain why this code uses ceil.
Comment 6 WebKit Commit Bot 2014-08-26 12:29:22 PDT
Comment on attachment 237160 [details]
Patch

Clearing flags on attachment: 237160

Committed r172970: <http://trac.webkit.org/changeset/172970>
Comment 7 WebKit Commit Bot 2014-08-26 12:29:25 PDT
All reviewed patches have been landed.  Closing bug.