Bug 138633 - Move FontMac and FontCacheMac off of WKSI
Summary: Move FontMac and FontCacheMac off of WKSI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 15:00 PST by Myles C. Maxfield
Modified: 2014-11-13 18:54 PST (History)
7 users (show)

See Also:


Attachments
Patch (36.74 KB, patch)
2014-11-11 15:54 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (36.92 KB, patch)
2014-11-11 16:36 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (36.80 KB, patch)
2014-11-11 17:01 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (36.86 KB, patch)
2014-11-11 18:53 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (38.45 KB, patch)
2014-11-12 10:14 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (39.37 KB, patch)
2014-11-12 23:00 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (39.37 KB, patch)
2014-11-12 23:01 PST, Myles C. Maxfield
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2014-11-11 15:00:45 PST
Move FontMac and FontCacheMac off of WKSI
Comment 1 Myles C. Maxfield 2014-11-11 15:54:38 PST
Created attachment 241386 [details]
Patch
Comment 2 Myles C. Maxfield 2014-11-11 16:36:17 PST
Created attachment 241392 [details]
Patch
Comment 3 Myles C. Maxfield 2014-11-11 17:01:57 PST
Created attachment 241396 [details]
Patch
Comment 4 Simon Fraser (smfr) 2014-11-11 17:34:46 PST
Comment on attachment 241396 [details]
Patch

Please fix windows.
Comment 5 Myles C. Maxfield 2014-11-11 18:53:09 PST
Created attachment 241406 [details]
Patch
Comment 6 Myles C. Maxfield 2014-11-12 10:14:14 PST
Created attachment 241432 [details]
Patch
Comment 7 Myles C. Maxfield 2014-11-12 23:00:23 PST
Created attachment 241472 [details]
Patch
Comment 8 Myles C. Maxfield 2014-11-12 23:01:06 PST
Created attachment 241473 [details]
Patch
Comment 9 Simon Fraser (smfr) 2014-11-13 14:42:39 PST
Comment on attachment 241473 [details]
Patch

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

> Source/WebCore/WebCore.xcodeproj/project.pbxproj:17544
>  				9348428119F1A9190009D5AE /* NSViewSPI.h */,
> +				1C6466271A12C3F90094603C /* NSFontSPI.h */,

This doesn't look sorted. Please run sort-Xcode-project-file

> Source/WebCore/platform/graphics/mac/FontMac.mm:183
> +static inline bool isIntegral(float value)
> +{
> +    return (int)value == value;
> +}

We should move this to MathUtils.h
Comment 10 Daniel Bates 2014-11-13 16:00:01 PST
Comment on attachment 241473 [details]
Patch

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

> Source/WebCore/ChangeLog:12
> +        * WebCore.vcxproj/WebCoreCG.props:

We should also consider updating Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters with the SPI directory and SPI files. See the changes I made in file Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters in the patch for bug #138709 (attachment #241514 [details]).
Comment 11 Daniel Bates 2014-11-13 16:29:36 PST
(In reply to comment #9)
> > Source/WebCore/platform/graphics/mac/FontMac.mm:183
> > +static inline bool isIntegral(float value)
> > +{
> > +    return (int)value == value;
> > +}
> 
> We should move this to MathUtils.h

We should also look to make use of this function in GraphicsLayerCA.cpp instead of defining it again: <http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=175794#L85> (*).

Also, I suggest we use a C++ style cast instead of a C-style cast as seen in (*) to be more consistent with the cast style we use in C++/Objective-C++ files.
Comment 12 Myles C. Maxfield 2014-11-13 17:25:23 PST
Comment on attachment 241473 [details]
Patch

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

>> Source/WebCore/WebCore.xcodeproj/project.pbxproj:17544
>> +				1C6466271A12C3F90094603C /* NSFontSPI.h */,
> 
> This doesn't look sorted. Please run sort-Xcode-project-file

Done.

>> Source/WebCore/platform/graphics/mac/FontMac.mm:183
>> +}
> 
> We should move this to MathUtils.h

Done.
Comment 13 Myles C. Maxfield 2014-11-13 17:31:43 PST
(In reply to comment #10)
> Comment on attachment 241473 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241473&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        * WebCore.vcxproj/WebCoreCG.props:
> 
> We should also consider updating
> Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters with the SPI
> directory and SPI files. See the changes I made in file
> Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters in the patch for bug
> #138709 (attachment #241514 [details]).

Done.
Comment 14 Myles C. Maxfield 2014-11-13 17:31:54 PST
(In reply to comment #11)
> (In reply to comment #9)
> > > Source/WebCore/platform/graphics/mac/FontMac.mm:183
> > > +static inline bool isIntegral(float value)
> > > +{
> > > +    return (int)value == value;
> > > +}
> > 
> > We should move this to MathUtils.h
> 
> We should also look to make use of this function in GraphicsLayerCA.cpp
> instead of defining it again:
> <http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/ca/
> GraphicsLayerCA.cpp?rev=175794#L85> (*).
> 
> Also, I suggest we use a C++ style cast instead of a C-style cast as seen in
> (*) to be more consistent with the cast style we use in C++/Objective-C++
> files.

Done.
Comment 15 Daniel Bates 2014-11-13 18:05:37 PST
Comment on attachment 241473 [details]
Patch

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

> Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h:35
> +#include <CoreGraphics/CGContextGState.h>
> +#include <CoreGraphics/CGFontCache.h>
> +#include <CoreGraphics/CGFontPrivate.h>
> +#include <CoreGraphics/CGFontUnicodeSupport.h>

Nit: These includes are unnecessary as CoreGraphicsPrivate.h ultimately includes them.
Comment 16 Daniel Bates 2014-11-13 18:12:44 PST
(In reply to comment #15)
> Comment on attachment 241473 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241473&action=review
> 
> > Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h:35
> > +#include <CoreGraphics/CGContextGState.h>
> > +#include <CoreGraphics/CGFontCache.h>
> > +#include <CoreGraphics/CGFontPrivate.h>
> > +#include <CoreGraphics/CGFontUnicodeSupport.h>
> 
> Nit: These includes are unnecessary as CoreGraphicsPrivate.h ultimately
> includes them.

Err, I meant that the includes <CoreGraphics/CGContextGState.h>, <CoreGraphics/CGFontPrivate.h> and <CoreGraphics/CGFontUnicodeSupport.h> are not necessary. That is, it should be sufficient to include headers <CoreGraphics/CGFontCache.h> and <CoreGraphics/CoreGraphicsPrivate.h>.
Comment 17 Myles C. Maxfield 2014-11-13 18:24:50 PST
http://trac.webkit.org/changeset/176112
Comment 18 Myles C. Maxfield 2014-11-13 18:54:01 PST
(In reply to comment #16)
> (In reply to comment #15)
> > Comment on attachment 241473 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=241473&action=review
> > 
> > > Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h:35
> > > +#include <CoreGraphics/CGContextGState.h>
> > > +#include <CoreGraphics/CGFontCache.h>
> > > +#include <CoreGraphics/CGFontPrivate.h>
> > > +#include <CoreGraphics/CGFontUnicodeSupport.h>
> > 
> > Nit: These includes are unnecessary as CoreGraphicsPrivate.h ultimately
> > includes them.
> 
> Err, I meant that the includes <CoreGraphics/CGContextGState.h>,
> <CoreGraphics/CGFontPrivate.h> and <CoreGraphics/CGFontUnicodeSupport.h> are
> not necessary. That is, it should be sufficient to include headers
> <CoreGraphics/CGFontCache.h> and <CoreGraphics/CoreGraphicsPrivate.h>.

Addressed in https://trac.webkit.org/r176114