Bug 162924 - [Win][Direct2D] Connect WebCore/WebKit Drawing
Summary: [Win][Direct2D] Connect WebCore/WebKit Drawing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit 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-04 11:08 PDT by Brent Fulgham
Modified: 2016-10-05 10:24 PDT (History)
5 users (show)

See Also:


Attachments
Patch (16.63 KB, patch)
2016-10-04 17:43 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-04 11:08:04 PDT
This patch updates the Windows WebKit layer to use Direct2D for drawing. It also touches a number of WebCore implementation files to supply Direct2D-compatible drawing logic, as well as stubbing out some routines that are not yet supported in this new drawing mode.

This patch simply adds the new files. It does not incorporate them into the build.
Comment 1 Brent Fulgham 2016-10-04 17:43:09 PDT
Created attachment 290675 [details]
Patch
Comment 2 WebKit Commit Bot 2016-10-04 17:45:46 PDT
Attachment 290675 [details] did not pass style-queue:


ERROR: Source/WebKit/win/WebView.cpp:1146:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2016-10-04 17:49:26 PDT
(In reply to comment #2)
> Attachment 290675 [details] did not pass style-queue:
> 
> 
> ERROR: Source/WebKit/win/WebView.cpp:1146:  Use the class HWndDC instead of
> calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Total errors found: 1 in 6 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.

This is an error in the style checker. The 'GetDC' function here is a conversion routine from Direct2D. It has nothing to do with the HWndDC class.
Comment 4 Alex Christensen 2016-10-05 00:19:38 PDT
Comment on attachment 290675 [details]
Patch

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

> Source/WebKit/win/WebView.cpp:1246
> +    m_renderTarget->SetTags(2, __LINE__);

Why?

> Source/WebKit/win/WebView.cpp:1276
> +    (void)hr;

Just don't name hr.
Comment 5 Brent Fulgham 2016-10-05 10:24:08 PDT
Comment on attachment 290675 [details]
Patch

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

>> Source/WebKit/win/WebView.cpp:1246
>> +    m_renderTarget->SetTags(2, __LINE__);
> 
> Why?

This is a debugging function. I'll add a macro for the first argument. When Flush or EndDraw has an error, it outputs these two numbers, which can be used to identify which drawing logic was executing at the time of a failure.

>> Source/WebKit/win/WebView.cpp:1276
>> +    (void)hr;
> 
> Just don't name hr.

I'll use UNUSED_PARAM, since I want access to 'hr' when debugging so I can see what the error was.
Comment 6 Brent Fulgham 2016-10-05 10:24:23 PDT
Committed r206816: <http://trac.webkit.org/changeset/206816>