Lines Matching defs:quad
20 // Pre-allocate space for 1 2D device-space quad, metadata, and header
25 // reserved for each entry to also have a 2D local quad. The reserved space assumes 2D device
26 // quad for simplicity. Since this buffer has a variable bitrate encoding for quads, this may
57 // Provides a read-only iterator over a quad buffer, giving access to the device quad, metadata
58 // and optional local quad.
100 // automatically while unpacking the quad data.
112 // Provides a *mutable* iterator over just the metadata stored in the quad buffer. This skips
159 // quad types of device and local coordinates, and always has metadata of type T. The device
170 // allocate storage for the quad buffer? Since this is forward-iteration only, could also
220 // next packed quad coordinates.
221 float* packQuad(const GrQuad& quad, float* coords);
222 const float* unpackQuad(GrQuad::Type type, const float* coords, GrQuad* quad) const;
234 float* GrQuadBuffer<T>::packQuad(const GrQuad& quad, float* coords) {
237 SkASSERT(quad.xs() + 4 == quad.ys() && quad.xs() + 8 == quad.ws());
238 if (quad.hasPerspective()) {
239 memcpy(coords, quad.xs(), k3DQuadFloats * sizeof(float));
242 memcpy(coords, quad.xs(), k2DQuadFloats * sizeof(float));
248 const float* GrQuadBuffer<T>::unpackQuad(GrQuad::Type type, const float* coords, GrQuad* quad) const {
249 SkASSERT(quad->xs() + 4 == quad->ys() && quad->xs() + 8 == quad->ws());
252 memcpy(quad->xs(), coords, k3DQuadFloats * sizeof(float));
255 // Fill in X and Y of the quad, the setQuadType() below will set Ws to 1 if needed
256 memcpy(quad->xs(), coords, k2DQuadFloats * sizeof(float));
260 quad->setQuadType(type);