Bug 162977 - [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
Summary: [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks: 161817
  Show dependency treegraph
 
Reported: 2016-10-05 10:33 PDT by Brent Fulgham
Modified: 2016-10-05 14:18 PDT (History)
4 users (show)

See Also:


Attachments
Patch (36.94 KB, patch)
2016-10-05 12:35 PDT, Brent Fulgham
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>