Issue 131581 in chromium: WebGL pixel doubled

23 views
Skip to first unread message

chro...@googlecode.com

unread,
Jun 7, 2012, 11:12:31 AM6/7/12
to chromi...@chromium.org
Status: Available
Owner: ----
CC: tha...@chromium.org, sad...@chromium.org, voll...@chromium.org,
dan...@chromium.org, jam...@chromium.org
Labels: Type-Bug Pri-1 Area-WebKit Feature-Ash-DIP Feature-GPU-WebGL
Mstone-22 Hotlist-Link

New issue 131581 by rjkr...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

WebGL content appears to be pixel doubled when running in deviceScaleFactor
== 2 mode. Hypothesis: we are building the WebGL's target surface in DIP
scale and then pixel doubling during compositing.


chro...@googlecode.com

unread,
Jun 7, 2012, 3:03:04 PM6/7/12
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: rjkr...@chromium.org
Labels: Action-ReductionNeeded

Comment #1 on issue 131581 by jam...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

Test case, please.

From what I can tell looking at the code I would expect the backing store
(drawing buffer in WebGL terms) to match the width/height attributes on the
canvas.

chro...@googlecode.com

unread,
Jun 7, 2012, 3:04:04 PM6/7/12
to chromi...@chromium.org

Comment #2 on issue 131581 by tha...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

http://www.webkit.org/blog-files/3d-transforms/poster-circle.html
reproduces this for me on mac at least.

chro...@googlecode.com

unread,
Jun 7, 2012, 3:06:04 PM6/7/12
to chromi...@chromium.org

Comment #3 on issue 131581 by jam...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

That's not WebGL

chro...@googlecode.com

unread,
Jun 7, 2012, 3:07:04 PM6/7/12
to chromi...@chromium.org

Comment #4 on issue 131581 by tha...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581



chro...@googlecode.com

unread,
Jun 8, 2012, 6:00:03 PM6/8/12
to chromi...@chromium.org

Comment #5 on issue 131581 by tha...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

I see this on mac, on all pages. That's caused by RWHVMac missing a call to
setWantsBestResolutionOpenGLSurface:YES. If I add this, the IOSurface that
the gpu process sends for the compositor output covers only half the width
and height of the window though.

chro...@googlecode.com

unread,
Jun 20, 2012, 3:45:31 PM6/20/12
to chromi...@chromium.org

Comment #10 on issue 131581 by rby...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

I can't get WebGL to work at all on the latest Mac canary (22.0.1181.0).
Nico, what site did you use to verify WebGL was working in high-DPI on Mac?

chro...@googlecode.com

unread,
Jun 20, 2012, 4:06:31 PM6/20/12
to chromi...@chromium.org

Comment #11 on issue 131581 by tha...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

rbyers: WebGL Aquarium

jamesr, gman (and rest): For Canvas2D, apple suggest the following logic to
decide if manual pixel doubling through CSS should be done:

// To create a 400x300 canvas:
if ( window.devicePixelRatio ) {
// LoDPI display, set canvas size to 400x300
} else {
var context = myCanvas.getContext("2d");
if (context.webkitBackingStorePixelRatio == 1) {
// currently the case on iOS. Set canvas size to 800x600 to get 800x600
// pixels, then size it to 400x300 via css. (XXX)
} else {
// current mac hidpi path. Create canvas in 400x300,
// it's transparently created with 800x600 pixels instead
}
}


It's conceivable they want to move iOS to the mac model too. I don't know
if something like that is feasible for webgl.

rbyers: For WebGL, pages currently have to do the path marked with (XXX).


(I think this bug is WontFix; maybe you want to repurpose it for discussing
if the canvas2d if webkitBackingStorePixelRatio trick could work here.
Probably not, as OpenGL is kind of pixel based.)

chro...@googlecode.com

unread,
Jun 20, 2012, 4:16:31 PM6/20/12
to chromi...@chromium.org
Updates:
Status: WontFix

Comment #12 on issue 131581 by jam...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

This has been discussed to death on the public-webgl list. Auto-doubling
(like Apple is doing with canvas 2d) is not feasible for WebGL. If the
WebGL content sets a backing store size that is equal to the CSS pixel size
times the device scale, then you can get 1:1.

chro...@googlecode.com

unread,
Jun 20, 2012, 8:32:43 PM6/20/12
to chromi...@chromium.org

Comment #14 on issue 131581 by rby...@chromium.org: WebGL pixel doubled
http://code.google.com/p/chromium/issues/detail?id=131581

Perfect, thanks for the details guys. I didn't know this had already been
discussed.

Reply all
Reply to author
Forward
0 new messages