Closed Bug 1285380 Opened 8 years ago Closed 8 years ago

Add compositor support for triangle layers

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mikokm, Assigned: mikokm)

References

Details

(Whiteboard: [gfx-noted])

In order to implement plane splitting for non-orthogonal and intersecting layers, the compositor has to be able to draw triangle layers.
Depends on: 1286412
Assignee: mikokm → nobody
Mentor: matt.woodrow
Status: ASSIGNED → NEW
Whiteboard: [gfx-noted]
Seems to be like maybe the optimal way to do this is to allow passing a visible region as a list of triangles and requiring us to clip to that, or something along those lines.
What exactly do you mean by clipping to that? The current plan was to replace the input rectangle with a triangle (though a list of them seems preferable) and then use that as the input geometry for the draw call (using GL_TRIANGLES).
Flags: needinfo?(bas)
Do you have any preference on what type we should pass at the Compositor API level? Some options: * A list of triangles (that are all touching and can be represented as a triangle strip/fan if the backend wants) * An explicit triangle strip format * An arbitrary polygon (a list of points that form an enclosed and convex polygon). The splitting algorithm is going to output the last option, so it's really deciding when to split it up into triangles.
(In reply to Matt Woodrow (:mattwoodrow) from comment #2) > What exactly do you mean by clipping to that? > > The current plan was to replace the input rectangle with a triangle (though > a list of them seems preferable) and then use that as the input geometry for > the draw call (using GL_TRIANGLES). Essentially that's what I mean. The thing is though the visible region is currently technically a 'hint' as per specification. We're not required to clip to it, we can draw things outside of it (that's what the clip is for). Presumably the intent here is very explicitly not to draw things outside the (list of) triangle(s). So in essence it would also describe a clip asides from just the desired geometry of the layer. Having said that, I perhaps like the last option, a convex polygon is very easy to tessellate, and if we have that anyway, it might make sense to describe any layer in that and assume only the convex polygon gets drawn.
Flags: needinfo?(bas)
(In reply to Bas Schouten (:bas.schouten) from comment #4) > (In reply to Matt Woodrow (:mattwoodrow) from comment #2) > > What exactly do you mean by clipping to that? > > > > The current plan was to replace the input rectangle with a triangle (though > > a list of them seems preferable) and then use that as the input geometry for > > the draw call (using GL_TRIANGLES). > > Essentially that's what I mean. The thing is though the visible region is > currently technically a 'hint' as per specification. We're not required to > clip to it, we can draw things outside of it (that's what the clip is for). My understanding was that Compositor::DrawQuad's 'aRect' parameter was more of an exact rect to draw, as opposed to the visible region on layer which behave exactly as you say. Anyway I think we're in agreement :) > > Presumably the intent here is very explicitly not to draw things outside the > (list of) triangle(s). So in essence it would also describe a clip asides > from just the desired geometry of the layer. Yeah, regardless of the definition of aRect, a DrawGeometry function taking a polgyon would want to restrict sampling to within that polygon. > > Having said that, I perhaps like the last option, a convex polygon is very > easy to tessellate, and if we have that anyway, it might make sense to > describe any layer in that and assume only the convex polygon gets drawn. I think (for the OpenGL backend at least) we'll still want to handle axis aligned rectangles differently, so not needing to figure this out again within the backend seems easier.
Depends on: 1323791
Depends on: 1323797
Assignee: nobody → mikokm
Status: NEW → ASSIGNED
Since D3D11, OpenGL, and SW compositor backends now support arbitrary geometry layers, I am marking this as fixed.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.