Closed
Bug 934813
Opened 11 years ago
Closed 11 years ago
Gallery: ImageProcessor.prototype.draw should not call bufferData everytime
Categories
(Firefox OS Graveyard :: Gaia::Gallery, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bjacob, Assigned: bjacob)
References
Details
Attachments
(2 files)
4.47 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
4.44 KB,
patch
|
bjacob
:
review+
|
Details | Diff | Splinter Review |
This is quite similar to bug 934790. Less critical, because a small WebGL buffer is cheaper to allocate than a larger WebGL texture, but still. There is no reason to reallocate the WebGL buffer storing the drawing geometry everytime. It also shouldn't depend on the parameters passed to draw(). Instead, just create once and for all a dummy buffer with the geometry of a dummy rectangle, and use uniforms to control its actual position and dimensions.
Assignee | ||
Comment 1•11 years ago
|
||
Also, only one buffer is needed instead of two, and it only needs 4 vertices with a TRIANGLE_STRIP, not 6.
Assignee | ||
Comment 2•11 years ago
|
||
Jeff: please review from WebGL correctness perspective. This patch should not make any rendering difference; if it somehow can, that's a bug. David: please review from Gallery perspective: this patch should not change anything in Gallery app besides how it uses WebGL.
Attachment #827786 -
Flags: review?(jgilbert)
Attachment #827786 -
Flags: review?(dflanagan)
Comment 3•11 years ago
|
||
Comment on attachment 827786 [details] [diff] [review] Don't upload buffers on every draw Review of attachment 827786 [details] [diff] [review]: ----------------------------------------------------------------- ::: apps/gallery/js/ImageEditor.js @@ +1347,5 @@ > > // Create buffers to hold the input and output rectangles > + this.rectangleBuffer = gl.createBuffer(); > + gl.bindBuffer(gl.ARRAY_BUFFER, this.rectangleBuffer); > + gl.disable(gl.CULL_FACE); Why do you disable CULL_FACE here in the middle of buffer stuff?
Attachment #827786 -
Flags: review?(jgilbert) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Oops, that was of course a remnant from debugging, sorry.
Assignee | ||
Comment 5•11 years ago
|
||
Removed the unwanted gl.disable(gl.CULL_FACE);
Attachment #8340644 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Attachment #827786 -
Flags: review?(dflanagan)
Assignee | ||
Updated•11 years ago
|
Attachment #8340644 -
Flags: review?(dflanagan)
Comment 6•11 years ago
|
||
Rolled this patch up with two others and resolved it in the parent bug.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Attachment #8340644 -
Flags: review?(dflanagan)
Updated•10 years ago
|
Assignee: nobody → bjacob
You need to log in
before you can comment on or make changes to this bug.
Description
•