Point containment for quadratic Bèzier strokes
AssigneeNVIDIA Corporation
InventorMark J. Kilgard
Life of this patent
Estimating the term…
Abstract
One embodiment of the present invention sets forth a technique for stroking rendered paths. Path rendering may be accelerated when a graphics processing unit or other processor is configured to identify pixels that are within half of the stroke width of any point along a path to be stroked. The path is represented by quadratic Bèzier segments and a cubic equation is evaluated to determine whether or not each point in a conservative hull that bounds the quadratic Bèzier segment is within the stroke width.
Claims20
A method of stroking quadratic Bèzier path segments, the method comprising:
- receiving a quadratic Bèzier path segment and a stroke width that defines a stroke region of the quadratic Bezier path segment;
- generating a hull geometry that bounds the quadratic Bèzier path segment;
- computing a set of parameters for the quadratic Bèzier path segment;
- for each sample point within the hull geometry, writing a result to a stencil buffer indicating whether the sample point is within the stroke region of the quadratic Bèzier path segment by evaluating a sample point-specific cubic equation based on the set of parameters;
- and
- filling, via a processing unit, the stroke region by writing a color buffer based on the stencil buffer.
A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to stroke quadratic Bèzier path segments, by performing the steps of:
- receiving a quadratic Bèzier path segment and a stroke width that defines a stroke region of the quadratic Bèzier path segment;
- generating a hull geometry that bounds the quadratic Bèzier path segment;
- computing a set of parameters for the quadratic Bèzier path segment;
- for each sample point within the hull geometry, writing a result to a stencil buffer indicating whether the sample point is within the stroke region of the quadratic Bèzier path segment by evaluating a sample point-specific cubic equation based on the set of parameters;
- and
- filling the stroke region by writing a color buffer based on the stencil buffer.
A system for stroking quadratic Bèzier path segments, the system comprising:
- a memory that is configured to store data indicating whether sample points are within a stroke region of a path;
- and
- a processor that is coupled to the memory and configured to:
- receive a quadratic Bèzier path segment and a stroke width that defines the stroke region;
- generate a hull geometry that bounds the quadratic Bèzier path segment;
- compute a set of parameters for the quadratic Bèzier path segment;
- for each sample point within the hull geometry, write a result to a stencil buffer indicating whether the sample point is within the stroke region of the quadratic Bèzier path segment by evaluate a sample point-specific cubic equation based on the set of parameters;
- and
- filling the stroke region by writing a color buffer based on the stencil buffer.
Dependencies are inferred from the claim text.