WebGL doesn't work with SkiaRenderer + SkDDL with GL backend |
|||||||||
Issue descriptionI found webGL stops working with SkiaRenderer + SkDDL with GL backend. Looks like there is a promise image fulfill issue.
,
Nov 5
I created a CL https://crbug.com/1318076 which fixes part of this issue. I think another part problem is Skia DDL related. If I comment out current_canvas_->scale(1, -1) in SkiaRenderer::DrawTextureQuad()[1], the WebGL content will show up on screen, but the content is upside down. [1] https://cs.chromium.org/chromium/src/components/viz/service/display/skia_renderer.cc?type=cs&q=SkiaRenderer::DrawTexture&g=0&l=743 Hi egdaniel@, Could you please take a look? Thanks.
,
Nov 5
Thanks for reporting this. Could you please link to any parent bugs under which you originally found this issue? Thanks.
,
Nov 6
,
Nov 6
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9ddf2d5046da2218aedb2cf69e76e0e5a584fd7c commit 9ddf2d5046da2218aedb2cf69e76e0e5a584fd7c Author: Peng Huang <penghuang@chromium.org> Date: Tue Nov 06 18:24:50 2018 Fix WebGL problem with SkiaRenderer + SkDDL + OOPR WebGL may use GL_RGB texture, and choose viz::RGBA_8888 as resource format. So to make WebGL work, we should not consider it an invalid combination. Bug: 901822 Change-Id: I4b6678492b2fb847d66de3fe8ec7b0049ca8eaff Reviewed-on: https://chromium-review.googlesource.com/c/1318076 Reviewed-by: Jonathan Backer <backer@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org> Cr-Commit-Position: refs/heads/master@{#605749} [modify] https://crrev.com/9ddf2d5046da2218aedb2cf69e76e0e5a584fd7c/components/viz/common/resources/resource_format_utils.cc [modify] https://crrev.com/9ddf2d5046da2218aedb2cf69e76e0e5a584fd7c/gpu/command_buffer/service/skia_utils.cc [modify] https://crrev.com/9ddf2d5046da2218aedb2cf69e76e0e5a584fd7c/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
,
Nov 6
Chome side issue has been fixed, re-assign it to egdaniel@ for Skia part issue.
,
Nov 6
So I had a short discussion with ericrk, and there is a chance it could be related to a change he recently made. The fact that removing the inversion causes something to draw, makes me think that this could be an issue in chrome where they need to not only invert the texture but also possible translate it (most likely would occur if the valid region of the texture is smaller than the whole texture allocation). Passing this ericrk for now to see if his changes may have broken something here.
,
Nov 6
FYI. SkiaRenderer works fine without SkDDL. It only happens if DDL is used, the fulfill function is not called for the promise texture of the WebGL content.
,
Nov 6
Do you know what is inherently different with a promise WegGL image versus other promise images you create with DDL? It will be a couple days till I can actually look into this myself. In the mean time as a complete shot in the dark, can you try adding the following line here: https://cs.chromium.org/chromium/src/third_party/skia/src/image/SkImage_Gpu.cpp?q=skimage_gpu&g=0&l=423 if (!context->contextPriv().caps()->isConfigTexturable(config)) { return nullptr; }
,
Nov 6
If fulfill is not being called, then this is unrelated to my change, back over to egdaniel@. Also, re-reading the code, WebGL shouldn't be hitting my codepaths yet unless this is with a WIP patch to move WebGL to SharedImage, which I'm assuming is not yet the case.
,
Nov 7
re: comment 9, I tried your suggestion, it doesn't make any different.
,
Nov 7
Passing to penghuang@ to answer a few questions. Can you confirm that with the canvas y flip applied we are getting a valid dst rect (i.e. the dest rect is actually in the bounds of the target). This won't happen if the y flip is causing the src rect to be negative, which I suspect could be the cause of the bug. We may need to do the y flip and then translate everything back up. If you can debug through the drawImageRect call you should be able to see if we drop the draw for being out of the bounds. Does the non ddl code go through this same code path (where you linked in #2) ? If so does it also do the scale by -1 on the canvas? If all that is true what is different about the webgl image draws from the normal image draws since DDL does all the normal image draws fine.
,
Nov 7
I am sorry. I was wrong. The non DDL case also has the problem (I was using a script to launch chrome, the script is still using the outdated flags). I will fix the problem.
,
Nov 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f2fef5671fb6850a4cdc203534f90483c35e2564 commit f2fef5671fb6850a4cdc203534f90483c35e2564 Author: Peng Huang <penghuang@chromium.org> Date: Fri Nov 09 17:47:46 2018 Fix SkiaRenderer WebGL content not show problem The WebGL content is a flipped TextureQuad. SkiaRenderer only flips the Y coordinate for drawImageRect(with canvas->scale(1, -1)). It will draw the image outside of the Window (y < 0). To fix this problem, we use canvas->translate(0, quad_rect.bottom()) to move it back into the window. Bug: 901822 Change-Id: I6b98f82fba896021e1c2878632b26a3bd8029845 Reviewed-on: https://chromium-review.googlesource.com/c/1324137 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#606892} [modify] https://crrev.com/f2fef5671fb6850a4cdc203534f90483c35e2564/components/viz/service/display/gl_renderer.cc [modify] https://crrev.com/f2fef5671fb6850a4cdc203534f90483c35e2564/components/viz/service/display/renderer_pixeltest.cc [modify] https://crrev.com/f2fef5671fb6850a4cdc203534f90483c35e2564/components/viz/service/display/skia_renderer.cc [add] https://crrev.com/f2fef5671fb6850a4cdc203534f90483c35e2564/components/viz/test/data/intersecting_flipped_blue_green_half_size_rectangles.png [add] https://crrev.com/f2fef5671fb6850a4cdc203534f90483c35e2564/components/viz/test/data/intersecting_non_flipped_blue_green_half_size_rectangles.png
,
Nov 9
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by penghuang@chromium.org
, Nov 5Status: Started (was: Untriaged)