microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

Invalid SwapChainPanelNativeWindow size calculation #66

Closed teshca closed 8 years ago

teshca commented 8 years ago

Let's say I have Lumia 920 with screen-size (768 x 1229) and scale-factor 2.25 DisplayInformation::GetForCurrentView()->RawPixelsPerViewPixel

I want my panel to feel whole screen. And I initialize my surface like this:

        float customResolutionScale = 2.25
        renderSurface_ = openGLES_.CreateSurface(swapChainPanel_, nullptr, &customResolutionScale);

And I expect to get 768 when I do eglQuerySurface(mEglDisplay, surface, EGL_WIDTH, width); but I got 767 and I can see this one pixel border on the right size of my panel. Especially if set background with some contrast color.

The problem I believe is that in GetSwapChainPanelSize the size is rounded to int and only then it is scaled (multiplied by 2.25). uiElement->get_RenderSize(&renderSize) returns 341.33333 and after lround we get 341 then after scale we get 767.25

so I think we should not lround swapChainPanelSize before we scale it.

austinkinross commented 8 years ago

Hi! Thanks a lot for your fix. The change looks very reasonable to me.

Unfortunately we don't take pull requests directly to this version of ANGLE, though. Please submit your change to the master version of ANGLE (http://www.angleproject.org), and we will pull it across to this version of ANGLE when it's submitted. A guide for contributing code to the master ANGLE branch is available here: https://chromium.googlesource.com/angle/angle/+/master/doc/ContributingCode.md

Feel free to include me (aukinros - at - microsoft - dot - com) on your code-reviews.

Thanks again, Austin

teshca commented 8 years ago

Not really sure I did everything right: https://chromium-review.googlesource.com/#/c/355020/

austinkinross commented 8 years ago

Thanks for posting the review over on the master ANGLE repository. I'm going to close this GitHub Issue since discussion has moved over to the master code-review.

Thanks again!