Bug 162977

Summary: [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebCore Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, dino, pvollan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 161817    
Attachments:
Description Flags
Patch achristensen: review+

Description Brent Fulgham 2016-10-05 10:33:30 PDT
Currently the Direct2D implementation does not support some of the accelerated compositing features that require CoreAnimation. During this bring-up, we want to disable these routines so that we can build and run in (mostly) unaccelerated drawing.

This change should have no impact on non-Direct2D ports.
Comment 1 Brent Fulgham 2016-10-05 10:34:36 PDT
This patch also contains a few minor clean-ups and drive-by fixes I identified in initial D2D web browsing.
Comment 2 Brent Fulgham 2016-10-05 12:35:11 PDT
Created attachment 290738 [details]
Patch
Comment 3 Alex Christensen 2016-10-05 12:44:53 PDT
Comment on attachment 290738 [details]
Patch

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

> Source/WebCore/page/win/FrameWinDirect2D.cpp:44
> +GDIObject<HBITMAP> imageFromRect(const Frame* frame, IntRect& ir)

const Frame& or null check

> Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:57
> +    UNUSED_PARAM(mimeType);

this can be outside the if.

> Source/WebCore/platform/win/DragImageDirect2D.cpp:77
> +    IntSize dstSize(static_cast<int>(srcSize.width() * scale.width()), static_cast<int>(srcSize.height() * scale.height()));

I think this is wrong.  Shouldn't it be width*scale, height*scale?

> Source/WebCore/platform/win/DragImageDirect2D.cpp:91
> +    HWndDC dc(0);

nullptr here and elsewhere.
Comment 4 Brent Fulgham 2016-10-05 14:17:42 PDT
Comment on attachment 290738 [details]
Patch

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

>> Source/WebCore/page/win/FrameWinDirect2D.cpp:44
>> +GDIObject<HBITMAP> imageFromRect(const Frame* frame, IntRect& ir)
> 
> const Frame& or null check

Done. I'm stuck with the signature for now based on existing code.

>> Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:57
>> +    UNUSED_PARAM(mimeType);
> 
> this can be outside the if.

Done.

>> Source/WebCore/platform/win/DragImageDirect2D.cpp:77
>> +    IntSize dstSize(static_cast<int>(srcSize.width() * scale.width()), static_cast<int>(srcSize.height() * scale.height()));
> 
> I think this is wrong.  Shouldn't it be width*scale, height*scale?

Scale can be asymmetric, so it is passed as a FloatSize. 'width()' returns the scale in the X direction, 'height()' returns the scaling factor in the Y direction.

>> Source/WebCore/platform/win/DragImageDirect2D.cpp:91
>> +    HWndDC dc(0);
> 
> nullptr here and elsewhere.

Done!
Comment 5 Brent Fulgham 2016-10-05 14:18:55 PDT
Committed r206830: <http://trac.webkit.org/changeset/206830>