Bug 89033 - [Chromium] Sub-pixel text rendering is incorrectly used for WebView with transparent background.
Summary: [Chromium] Sub-pixel text rendering is incorrectly used for WebView with tran...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Reveman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-13 13:35 PDT by David Reveman
Modified: 2012-06-14 17:43 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.44 KB, patch)
2012-06-13 13:43 PDT, David Reveman
no flags Details | Formatted Diff | Diff
Patch (4.40 KB, patch)
2012-06-14 12:08 PDT, David Reveman
no flags Details | Formatted Diff | Diff
Patch (4.63 KB, patch)
2012-06-14 14:07 PDT, David Reveman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Reveman 2012-06-13 13:35:15 PDT
This is only a problem when software rendering is used. The compositor already handles this properly.
Comment 1 David Reveman 2012-06-13 13:43:49 PDT
Created attachment 147402 [details]
Patch

Possible fix. Not sure if this is how we want solve this.
Comment 2 James Robinson 2012-06-13 14:05:26 PDT
https://bugs.webkit.org/show_bug.cgi?id=89031 happens to solve this.
Comment 3 James Robinson 2012-06-13 14:06:07 PDT
Comment on attachment 147402 [details]
Patch

I think you'd be better off calling setDrawingToImageBuffer() in NonCompositedContentHost, or just waiting for https://bugs.webkit.org/show_bug.cgi?id=89031
Comment 4 David Reveman 2012-06-14 08:35:23 PDT
(In reply to comment #2)
> https://bugs.webkit.org/show_bug.cgi?id=89031 happens to solve this.

(In reply to comment #3)
> (From update of attachment 147402 [details])
> I think you'd be better off calling setDrawingToImageBuffer() in NonCompositedContentHost, or just waiting for https://bugs.webkit.org/show_bug.cgi?id=89031

I'm confused. This patch is to avoid sub-pixel rendering in software mode. Not when the compositor is used which is already handled correctly. So changes to NonCompositedContentHost isn't going to help here afaik.

Tried the patch attached to https://bugs.webkit.org/show_bug.cgi?id=89031 and it doesn't fix the problem.
Comment 5 James Robinson 2012-06-14 10:02:44 PDT
Comment on attachment 147402 [details]
Patch

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

> Source/WebKit/chromium/src/WebPagePopupImpl.cpp:240
> +    PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, !m_webView->isTransparent());

this isn't obvious to me - if a web view is transparent, does that really mean that popups associated with that view are also transparent?  how is the background color of a popup determined?
Comment 6 James Robinson 2012-06-14 10:02:51 PDT
Ah sorry, I didn't realize this was for software mode.
Comment 7 David Reveman 2012-06-14 12:06:33 PDT
(In reply to comment #5)
> (From update of attachment 147402 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=147402&action=review
> 
> > Source/WebKit/chromium/src/WebPagePopupImpl.cpp:240
> > +    PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, !m_webView->isTransparent());
> 
> this isn't obvious to me - if a web view is transparent, does that really mean that popups associated with that view are also transparent?  how is the background color of a popup determined?

yea, that's wrong. popups are always opaque afaik. WebPagePopupImpl::initPage() calls frame->view()->setTransparent(false).

btw, not sure how to test this other than the manual testing I'm doing on chromeos right now. any ideas?
Comment 8 David Reveman 2012-06-14 12:08:44 PDT
Created attachment 147626 [details]
Patch

Popups are always opaque
Comment 9 James Robinson 2012-06-14 12:23:00 PDT
(In reply to comment #7)
> (In reply to comment #5)
> > (From update of attachment 147402 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=147402&action=review
> > 
> > > Source/WebKit/chromium/src/WebPagePopupImpl.cpp:240
> > > +    PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, !m_webView->isTransparent());
> > 
> > this isn't obvious to me - if a web view is transparent, does that really mean that popups associated with that view are also transparent?  how is the background color of a popup determined?
> 
> yea, that's wrong. popups are always opaque afaik. WebPagePopupImpl::initPage() calls frame->view()->setTransparent(false).
> 
> btw, not sure how to test this other than the manual testing I'm doing on chromeos right now. any ideas?

So sadly we force grayscale all the time with layout tests, so there's no way that I know of in WebKit to check this automatically :(
Comment 10 James Robinson 2012-06-14 12:29:25 PDT
Comment on attachment 147626 [details]
Patch

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

R=me but consider 2-state enum instead of bool for the paint parameter

> Source/WebKit/chromium/src/WebPagePopupImpl.cpp:240
> +    PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, true);

this is a good sign that we want a two-state enum here instead of a bool - it's really hard to guess what "true" means in this context.
Comment 11 David Reveman 2012-06-14 14:07:04 PDT
Created attachment 147650 [details]
Patch

Add two-state enum
Comment 12 WebKit Review Bot 2012-06-14 17:43:23 PDT
Comment on attachment 147650 [details]
Patch

Clearing flags on attachment: 147650

Committed r120381: <http://trac.webkit.org/changeset/120381>
Comment 13 WebKit Review Bot 2012-06-14 17:43:27 PDT
All reviewed patches have been landed.  Closing bug.