Bug 60939 - Designer grid lines sometimes render improperly when GPU rendering enabled
Summary: Designer grid lines sometimes render improperly when GPU rendering enabled
Status: NEW
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android Designer ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-12-01 06:49 UTC by Bret Johnson [MSFT]
Modified: 2017-12-12 23:40 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Nexus 10 (90.72 KB, image/png)
2017-12-01 06:49 UTC, Bret Johnson [MSFT]
Android TV (127.92 KB, image/png)
2017-12-01 06:51 UTC, Bret Johnson [MSFT]
Skipped grid lines (Nexus 7 software rendering) (60.12 KB, image/png)
2017-12-01 06:53 UTC, Bret Johnson [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 60939 on Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:

Description Bret Johnson [MSFT] 2017-12-01 06:49:05 UTC
Created attachment 25880 [details]
Nexus 10

On my Windows machine, when the Material Design Grid is enabled, and the device is set to one of the larger ones, there's a bunch of extra lines painted in the grid. See attached screenshots.

The problem goes away when GPU rendering is disabled in VS (Tools / Options / Environment / General / Use hardware graphics acceleration if available).

On the main device list Pixel C, Nexus 7, and Nexus 10 seem to cause this.
Android TV (1080p) is the worst, with a gazillion extra lines, where it takes 7 seconds to render.

Jeremie doesn't see this on his Windows machine, so presumably it's specific to graphics hardware, driver, maybe Windows version, or something. I've got a GTX 970. But I haven't noticed rendering anomalies anywhere else in Windows, so maybe there is some bug on our side too that's a contributing factor - it's probably worth giving that code a once over.

Us forcing always using software rendering here is an attractive option.
Maybe we could set RenderMode.SoftwareOnly on the WPF window, draw the grid lines, then switch back to the default render setting. See https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf. Or maybe there's a better way.

As a separate issue - but possibly related - I see that sometimes grid lines are skipped when we paint (have a 0px width instead of 1px?). That's true for both software & hardware rendering. But it makes things look a little funny. See last attachment. Can we force the lines to always have a 1 px min width?
Comment 1 Bret Johnson [MSFT] 2017-12-01 06:51:11 UTC
Created attachment 25881 [details]
Android TV
Comment 2 Bret Johnson [MSFT] 2017-12-01 06:53:02 UTC
Created attachment 25882 [details]
Skipped grid lines (Nexus 7 software rendering)
Comment 3 Jon Douglas [MSFT] 2017-12-12 23:40:30 UTC
I'm not able to reproduce this using a GTX 980 TI. Running Windows 10 Pro - 10.0.16299 Build 16299