Issue 14637 in skia: Image shader from MakeLazyImageFromTextureSource draws black screen

1 view
Skip to first unread message

satco… via monorail

unread,
Jul 24, 2023, 2:44:55 AM7/24/23
to bu...@skia.org
Status: Untriaged
Owner: ----
Priority: Medium
Type: Defect

New issue 14637 by satco...@gmail.com: Image shader from MakeLazyImageFromTextureSource draws black screen
https://bugs.chromium.org/p/skia/issues/detail?id=14637

What steps will reproduce the problem?
1. Fetch image as blob
2. Create ImageBitmap from blob with [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/createImageBitmap)
3. Create Image from bitmap with CanvasKit.MakeLazyImageFromTextureSource
4. Create Shader from Image
5. Set shader to Paint
6. Draw rect with Paint


What is the expected output? What do you see instead?
Draw image to surface


What version of the product are you using? On what operating system?
- canvaskit/0.38.2 57f648e
- chrome 114.0.5735.201
- windows 11 22H2 22621.1992


Please submit a code sample via fiddle.skia.org showing the issue.
https://jsfiddle.skia.org/canvaskit/c351f6c13a55457731107786332ddf5f0f9f17c660bcf5ef3a06e76aaa37109b


Provide any additional information below.
It works in canvaskit/0.37.2 4d519a8

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

micha… via monorail

unread,
Jul 24, 2023, 9:11:03 AM7/24/23
to bu...@skia.org
Updates:
Cc: jam...@google.com
Labels: Area-GPU Area-CanvasKit
Owner: kjlu...@google.com
Status: Accepted

Comment #1 on issue 14637 by michae...@google.com: Image shader from MakeLazyImageFromTextureSource draws black screen
https://bugs.chromium.org/p/skia/issues/detail?id=14637#c1

@Kevin, is a canvas image created with createImageBitmap meant to be a valid texture source for a function such as MakeLazyImageFromTextureSource?

If so, this should probably be passed to James, the GPU gardener.

kjlub… via monorail

unread,
Jul 24, 2023, 9:45:34 AM7/24/23
to bu...@skia.org

Comment #2 on issue 14637 by kjlu...@google.com: Image shader from MakeLazyImageFromTextureSource draws black screen
https://bugs.chromium.org/p/skia/issues/detail?id=14637#c2

Yes, that should be supported by the underlying call to texImage2D: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D

Possible cause was the refactoring/decoupling of the Ganesh backend from image. e.g. the stuff related to https://github.com/google/skia/blob/main/include/private/gpu/ganesh/GrTextureGenerator.h
Reply all
Reply to author
Forward
0 new messages