Always initialize geometry domain if it's written to the GPU

Bug: chromium:948499
Change-Id: I19efe6bb73b0926a79d3ae629a22efa8ea500b18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207864
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2019-04-12 09:23:22 -04:00 committed by Skia Commit-Bot
parent 01e1f4df7f
commit 25071cc52b

View File

@ -763,11 +763,15 @@ void* Tessellate(void* vertices, const VertexSpec& spec, const GrPerspQuad& devi
maxCoverage = compute_nested_quad_vertices(
aaFlags, spec.deviceQuadType() <= GrQuadType::kRectilinear, &inner, &outer,
&geomDomain);
} else if (spec.requiresGeometryDomain()) {
// The quad itself wouldn't need a geometric domain, but the batch does, so set the
// domain to the bounds of the X/Y coords. Since it's non-AA, this won't actually be
// evaluated by the shader, but make sure not to upload uninitialized data.
geomDomain.fLeft = outer.fX.min();
geomDomain.fRight = outer.fX.max();
geomDomain.fTop = outer.fY.min();
geomDomain.fBottom = outer.fY.max();
}
// NOTE: could provide an even more optimized tessellation function for axis-aligned
// rects since the positions can be outset by constants without doing vector math,
// except it must handle identifying the winding of the quad vertices if the transform
// applied a mirror, etc. The current 2D case is already adequately fast.
// Write two quads for inner and outer, inner will use the
write_quad(&vb, spec, mode, maxCoverage, color4f, geomDomain, domain, inner);