Bug 148085 - [WinCairo] Accelerated compositing does not respect device scale factor.
Summary: [WinCairo] Accelerated compositing does not respect device scale factor.
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-17 12:20 PDT by peavo
Modified: 2015-08-17 13:40 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.06 KB, patch)
2015-08-17 12:30 PDT, peavo
bfulgham: review+
bfulgham: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2015-08-17 12:20:35 PDT
Painting in accelerated compositing mode on WinCairo needs to take the device scale factor into account.
Comment 1 peavo 2015-08-17 12:30:27 PDT
Created attachment 259171 [details]
Patch
Comment 2 Alex Christensen 2015-08-17 12:40:27 PDT
Comment on attachment 259171 [details]
Patch

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

does this fix pages like acko.net ?

> Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp:166
> +    TransformationMatrix m;
> +    m.scale(deviceScaleFactor());
> +    double tx = (size.width() - size.width() / deviceScaleFactor()) / 2.0;
> +    double ty = (size.height() - size.height() / deviceScaleFactor()) / 2.0;
> +    m.translate(tx, ty);

Why scale then translate?  Where does the 2.0 come from?
Comment 3 Brent Fulgham 2015-08-17 12:41:46 PDT
Comment on attachment 259171 [details]
Patch

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

r=me, with a few minor corrections.

> Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp:165
> +    double ty = (size.height() - size.height() / deviceScaleFactor()) / 2.0;

Is this to center the view?

> Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h:55
> +    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint) override;

Please remove 'virtual' for any methods that are 'override'.
Comment 4 peavo 2015-08-17 12:46:18 PDT
(In reply to comment #3)
> Comment on attachment 259171 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259171&action=review
> 
> r=me, with a few minor corrections.
> 

Thanks!

> > Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp:165
> > +    double ty = (size.height() - size.height() / deviceScaleFactor()) / 2.0;
> 
> Is this to center the view?
> 

Yes, I will add a comment before landing.

> > Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h:55
> > +    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint) override;
> 
> Please remove 'virtual' for any methods that are 'override'.

Ok, I will remove 'virtual' before landing :)
Comment 5 peavo 2015-08-17 12:48:20 PDT
(In reply to comment #2)
> Comment on attachment 259171 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259171&action=review
> 

Thanks for reviewing :)

> does this fix pages like acko.net ?
> 

Yes, I believe so.

> > Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp:166
> > +    TransformationMatrix m;
> > +    m.scale(deviceScaleFactor());
> > +    double tx = (size.width() - size.width() / deviceScaleFactor()) / 2.0;
> > +    double ty = (size.height() - size.height() / deviceScaleFactor()) / 2.0;
> > +    m.translate(tx, ty);
> 
> Why scale then translate?  Where does the 2.0 come from?

The translate will center the view.
Comment 6 peavo 2015-08-17 13:25:46 PDT
Committed r188537: <http://trac.webkit.org/changeset/188537>.
Comment 7 Alex Christensen 2015-08-17 13:33:46 PDT
Looks great!  Thanks!
Comment 8 peavo 2015-08-17 13:40:17 PDT
(In reply to comment #7)
> Looks great!  Thanks!

Glad to hear it :)