Closed
Bug 1024149
Opened 10 years ago
Closed 8 years ago
webgl-1.0.3 conformance failure texture upload size
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: wlitwinczyk, Assigned: mtseng)
Details
Attachments
(1 file)
4.89 KB,
patch
|
jgilbert
:
review+
roc
:
review+
|
Details | Diff | Splinter Review |
http://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/texture-upload-size.html When an SVG is resized using "img.width *= 2" the WebGLContext::TexImage2D (line 434) function recieves the old size. As far as I can tell this is an SVG issue and not something to do with WebGL. I don't know enough about how everything interacts to be sure, but from the looking around and debugging I've done this seems to be the case.
Hey Cam, can you provide any info on this? Or point to a person on SVG that can. thanks Dan
Flags: needinfo?(cam)
Comment 2•10 years ago
|
||
The test does this: img.width *= 2; img.height *= 2; if (test.isSVG) { testUpload(img, img.width, img.height); } else { testUpload(img, width, height); } So for the PNG, it expects the texture to be the original size of the PNG, not whatever size the <img> has been stretched to. But for SVG, it expects the texture size to be whatever size the <img> is, not the underlying intrinsic size of the SVG document. Is this behaviour supported by the spec? What does it say the texture size should be when texImage2D is passed an <img> (be it PNG or SVG)?
Flags: needinfo?(cam)
The spec says: 6.7 Texture Upload Width and Height Unless width and height parameters are explicitly specified, the width and height of the texture set by texImage2D and the width and height of the sub-rectangle updated by texSubImage2D are determined based on the uploaded element or image data the following way: [...] HTMLImageElement image: If a bitmap is uploaded, the width and height of the texture are set to the width and height of the uploaded bitmap in pixels. If an SVG image is uploaded, the width and height of the texture are set to the current values of the width and height properties of image. [...]
Reporter | ||
Comment 4•10 years ago
|
||
This is the stack trace for when TexImage2D is called (mostly for my benefit): #1 http://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLContext.h?from=WebGLContext.h#488 #2 http://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLContext.h?from=WebGLContext.h#1127 #3 http://dxr.mozilla.org/mozilla-central/source/dom/canvas/WebGLContext.h?from=WebGLContext.h#1122 #4 http://dxr.mozilla.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#5746 #5 http://dxr.mozilla.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#5697 #6 http://dxr.mozilla.org/mozilla-central/source/image/src/VectorImage.cpp?from=VectorImage.cpp&case=true#524 #7 http://dxr.mozilla.org/mozilla-central/source/image/src/SVGDocumentWrapper.cpp#81 #8 http://dxr.mozilla.org/mozilla-central/source/content/svg/content/src/SVGSVGElement.cpp#223 Where a 1 for width and 2 for height is returned instead of 2 and 4. For a PNG image everything is the same up through #5. From there it goes to: #6 http://dxr.mozilla.org/mozilla-central/source/image/src/RasterImage.cpp#584 ^ which returns the upload width and height.
Assignee | ||
Comment 5•8 years ago
|
||
Attachment #8699866 -
Flags: review?(jgilbert)
Assignee | ||
Updated•8 years ago
|
Assignee: wlitwinczyk → mtseng
Status: NEW → ASSIGNED
Comment 6•8 years ago
|
||
Comment on attachment 8699866 [details] [diff] [review] Use element size for upload texture when using SVG image. Review of attachment 8699866 [details] [diff] [review]: ----------------------------------------------------------------- Over to :roc for review or delegation. ::: layout/base/nsLayoutUtils.cpp @@ +6934,5 @@ > result.mIsPremultiplied = false; > } > > int32_t imgWidth, imgHeight; > + nsCOMPtr<nsIContent> content = do_QueryInterface(aElement); I can't review this properly.
Attachment #8699866 -
Flags: review?(roc)
Attachment #8699866 -
Flags: review?(jgilbert)
Attachment #8699866 -
Flags: review+
Attachment #8699866 -
Flags: review?(roc) → review+
Assignee | ||
Comment 7•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a482ed2f4973
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3fbbaedcf495
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•