Bug 149516 - [Win] Support composited content in WebView render-to-context methods
Summary: [Win] Support composited content in WebView render-to-context methods
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-23 22:02 PDT by Brent Fulgham
Modified: 2015-09-24 20:41 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.17 KB, patch)
2015-09-23 23:02 PDT, Brent Fulgham
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 Brent Fulgham 2015-09-23 22:02:21 PDT
The current implementations of WebView::paintDocumentRectToContext and WebView::paintScrollViewRectToContextAtPoint only draw GDI-based content into the passed device context. This causes CALayer-based information to be skipped, since it typically draws on its own 60-hz timer outside of the normal paint operation.

The purpose of these two methods is to allow a WebView to be rendered into a specific device context, usually representing a bitmap or back buffer. Consequently, we should perform a draw operation from the CALayerTree into the context when this method is called.
Comment 1 Brent Fulgham 2015-09-23 22:02:57 PDT
<rdar://problem/22635080>
Comment 2 Brent Fulgham 2015-09-23 23:02:27 PDT
Created attachment 261862 [details]
Patch
Comment 3 Simon Fraser (smfr) 2015-09-24 08:10:36 PDT
Comment on attachment 261862 [details]
Patch

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

> Source/WebKit/win/WebView.cpp:6165
> +            ::ValidateRect(m_viewWindow, nullptr);

Is it correct to validate a rect in the window when you may be painting into an unrelated DC?

> Source/WebKit/win/WebView.cpp:6192
> +            ::ValidateRect(m_viewWindow, nullptr);

Ditto. Also why isn't this code shared?
Comment 4 Brent Fulgham 2015-09-24 08:59:41 PDT
Comment on attachment 261862 [details]
Patch

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

>> Source/WebKit/win/WebView.cpp:6165
>> +            ::ValidateRect(m_viewWindow, nullptr);
> 
> Is it correct to validate a rect in the window when you may be painting into an unrelated DC?

I think you are right. This should not be used here.

>> Source/WebKit/win/WebView.cpp:6192
>> +            ::ValidateRect(m_viewWindow, nullptr);
> 
> Ditto. Also why isn't this code shared?

It should be. I'll revise that.
Comment 5 Brent Fulgham 2015-09-24 20:41:52 PDT
Committed r190235: <http://trac.webkit.org/changeset/190235>