Bug 163385 - [Win][Direct2D] Compile fixes.
Summary: [Win][Direct2D] Compile fixes.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 06:32 PDT by Per Arne Vollan
Modified: 2016-10-14 04:50 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.59 KB, patch)
2016-10-13 06:39 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.59 KB, patch)
2016-10-13 11:00 PDT, Per Arne Vollan
bfulgham: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2016-10-13 06:32:23 PDT
When compiling with Direct2D enabled, I get a couple of compile errors.
Comment 1 Per Arne Vollan 2016-10-13 06:39:14 PDT
Created attachment 291477 [details]
Patch
Comment 2 WebKit Commit Bot 2016-10-13 06:40:07 PDT
Attachment 291477 [details] did not pass style-queue:


ERROR: Source/WebCore/config.h:0:  Use #pragma once header guard.  [build/header_guard] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alex Christensen 2016-10-13 08:26:43 PDT
Comment on attachment 291477 [details]
Patch

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

> Source/WebCore/config.h:111
> +#if USE(CG) || PLATFORM(WIN)

This shouldn't be necessary if we are using Cairo. Make it if use direct2d. 
I think it would be even better if we found where we are using CG floats and changed them. We probably shouldn't use CG floats with other rendering backends.
Comment 4 Per Arne Vollan 2016-10-13 11:00:43 PDT
Created attachment 291496 [details]
Patch
Comment 5 Per Arne Vollan 2016-10-13 11:01:35 PDT
(In reply to comment #3)
> Comment on attachment 291477 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=291477&action=review
> 
> > Source/WebCore/config.h:111
> > +#if USE(CG) || PLATFORM(WIN)
> 
> This shouldn't be necessary if we are using Cairo. Make it if use direct2d. 
> I think it would be even better if we found where we are using CG floats and
> changed them. We probably shouldn't use CG floats with other rendering
> backends.

Thanks for reviewing :) Updated patch.
Comment 6 WebKit Commit Bot 2016-10-13 11:03:07 PDT
Attachment 291496 [details] did not pass style-queue:


ERROR: Source/WebCore/config.h:0:  Use #pragma once header guard.  [build/header_guard] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Darin Adler 2016-10-13 12:10:03 PDT
Comment on attachment 291496 [details]
Patch

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

> Source/WebCore/config.h:112
> +#if USE(CG) || USE(DIRECT2D)
>  #ifndef CGFLOAT_DEFINED

I don’t understand why we would want to define CGFloat when using Direct2D.
Comment 8 Brent Fulgham 2016-10-13 12:44:03 PDT
Comment on attachment 291496 [details]
Patch

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

>> Source/WebCore/config.h:112
>>  #ifndef CGFLOAT_DEFINED
> 
> I don’t understand why we would want to define CGFloat when using Direct2D.

I agree. I don't need this change locally. If you are getting a build error while enabling Direct2D, I'd love to see the error message.

It might be that some CG code is getting build that should not. Or, perhaps we have something defined in terms of CGFloat that we should be using a different type for.
Comment 9 Brent Fulgham 2016-10-13 12:45:33 PDT
Comment on attachment 291496 [details]
Patch

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

> Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h:-35
> -interface IWICImagingFactory;

I was purposely not including <WinCodec> here to avoid pulling it in when not needed. Were you finding that you needed to add "include <WinCodec>" in more CPP files than "ImageDecoderDIrect2D.cpp"?

I think it's better to add the #include in individual CPP files, rather than force everything that includes the header to also pull in big Microsoft header files.
Comment 10 Per Arne Vollan 2016-10-14 04:50:37 PDT
(In reply to comment #8)
> Comment on attachment 291496 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=291496&action=review
> 
> >> Source/WebCore/config.h:112
> >>  #ifndef CGFLOAT_DEFINED
> > 
> > I don’t understand why we would want to define CGFloat when using Direct2D.
> 
> I agree. I don't need this change locally. If you are getting a build error
> while enabling Direct2D, I'd love to see the error message.
> 
> It might be that some CG code is getting build that should not. Or, perhaps
> we have something defined in terms of CGFloat that we should be using a
> different type for.

Maybe our WebKitSystemInterface.h files are different?

I am getting this error:

WebKitSystemInterface.h(78): error C2065: 'CGFloat': undeclared identifier (compiling source file C:\Projects\WebKit2\OpenSource\Source\WebCore\platform\network\cf\CookieStorageCFNet.cpp)