Lines Matching defs:layer
145 static void inc_layer() { ++gLayerCounter; printf("----- inc layer %d\n", gLayerCounter); }
146 static void dec_layer() { --gLayerCounter; printf("----- dec layer %d\n", gLayerCounter); }
287 * We implement ImageFilters for a given draw by creating a layer, then applying the
288 * imagefilter to the pixels of that layer (its backing surface/image), and then
289 * we call restore() to xfer that layer to the main canvas.
296 * 3. Restore the layer created in #1
297 * The imagefilter is passed the buffer/surface from the layer (now filled with the
299 * draw onto the previous layer using the xfermode from the original paint.
304 // paint. It's used to determine the size of the offscreen layer for filters.
307 // Draw functions should use layer->paint() instead of the passed-in paint.
658 // no need for the layer (or any of the draws until the matching restore()
685 // In our current design/features, we should never have a layer (src) in a different colorspace
687 // we add some feature in the future to allow a given layer/imagefilter to operate in a specific
711 // Compute suitable transformations and layer bounds for a new layer that will be used as the source
716 // Returns an empty rect if the layer wouldn't draw anything after filtering.
738 // be necessary to discard the bounds for subsequent layer calculations.
743 // Determine initial mapping and a reasonable maximum dimension to prevent layer-to-device
749 // Push scale factor into layer matrix and device matrix (net no change, but the layer will have
757 // theoretically unbounded under those conditions. Under a 45 degree rotation, a layer needs to
760 // use more relative resolution than a larger layer).
769 // When a filter is involved, the layer size may be larger than the default maxLayerDim due
781 // For better or for worse, user bounds currently act as a hard clip on the layer's
814 // ensuring plenty of alpha bits for the layer, perhaps losing some color bits in return.
822 // filters. If the layer can be drawn as a sprite, these can be downgraded.
839 // in this device space (referred to as the "layer" space). However, the filter
869 // The above mapping transforms from local to dst's device space, where the layer space
964 // since a layer is being made regardless (SkImageFilter::isColorFilterNode)
1008 // transparent black, then the new layer must be sized such that it covers the entire device
1009 // clip bounds of the prior device (otherwise edges of the temporary layer would be visible).
1014 // clipping a layer visually, we can respect the fact that the color filter affects transparent
1023 // Do this before we create the layer. We don't call the public save() since that would invoke a
1028 // Early out if the layer wouldn't draw anything
1032 // Build up the paint for restoring the layer, taking only the pieces of rec.fPaint that are
1038 // Smooth non-axis-aligned layer edges; this automatically downgrades to non-AA for aligned
1039 // layer restores. This is done to match legacy behavior where the post-applied MatrixTransform
1048 // Size the new layer relative to the prior device, which may already be aligned for filters.
1095 // Either we weren't meant to allocate a full layer, or the full layer creation failed.
1096 // Using an explicit NoPixelsDevice lets us reflect what the layer state would have been
1117 // not much we can do but clean up the layer and mark the clip as empty. This tends to come
1176 // a client, and the drawClippedToSaveBehind below). Since this is not saving a layer, with its
1199 std::unique_ptr<Layer> layer = std::move(fMCRec->fLayer);
1225 // Draw the layer's device contents into the now-current older device. We can't call public
1227 if (layer && !layer->fDevice->isNoPixelsDevice() && !layer->fDiscard) {
1228 layer->fDevice->setImmutable();
1234 if (layer->fImageFilter) {
1235 this->internalDrawDeviceWithFilter(layer->fDevice.get(), // src
1237 layer->fImageFilter.get(),
1238 layer->fPaint,
1245 dstDev->drawDevice(layer->fDevice.get(), sampling, layer->fPaint);
1457 // device; any other device for a saved layer will be clipped back to the base device during its
1468 SkASSERT(this->topDevice() == this->baseDevice()); // shouldn't be in a nested layer
1496 // and the clip restriction will be respected automatically during a restore of the layer.
1970 auto layer = this->aboutToDraw(this, paint, nullptr, CheckForOverwrite::kYes);
1971 if (layer) {
1972 this->topDevice()->drawPaint(layer->paint());
1998 auto layer = this->aboutToDraw(this, strokePaint, &bounds);
1999 if (layer) {
2000 this->topDevice()->drawPoints(mode, count, pts, layer->paint());
2010 auto layer = this->aboutToDraw(this, paint, &r, CheckForOverwrite::kYes);
2011 if (layer) {
2012 this->topDevice()->drawRect(r, layer->paint());
2022 auto layer = this->aboutToDraw(this, paint, &bounds);
2023 if (layer) {
2024 this->topDevice()->drawRegion(region, layer->paint());
2054 // filter on it (which is applied before any auto-layer so the filter is clipped).
2064 auto layer = this->aboutToDraw(this, paint);
2065 if (layer) {
2066 this->topDevice()->drawPaint(layer->paint());
2078 auto layer = this->aboutToDraw(this, paint, &oval);
2079 if (layer) {
2080 this->topDevice()->drawOval(oval, layer->paint());
2092 auto layer = this->aboutToDraw(this, paint, &oval);
2093 if (layer) {
2094 this->topDevice()->drawArc(oval, startAngle, sweepAngle, useCenter, layer->paint());
2116 auto layer = this->aboutToDraw(this, paint, &bounds);
2117 if (layer) {
2118 this->topDevice()->drawRRect(rrect, layer->paint());
2128 auto layer = this->aboutToDraw(this, paint, &bounds);
2129 if (layer) {
2130 this->topDevice()->drawDRRect(outer, inner, layer->paint());
2148 auto layer = this->aboutToDraw(this, paint, &pathBounds);
2149 if (layer) {
2150 this->topDevice()->drawPath(path, layer->paint());
2217 // of first drawing the image to a temporary layer and filtering.
2226 // will probably look just as good and not require an extra layer.
2241 auto layer = this->aboutToDraw(this, realPaint, &bounds);
2242 if (layer) {
2244 layer->paint(), kStrict_SrcRectConstraint);
2257 auto layer = this->aboutToDraw(this, realPaint, &dst, CheckForOverwrite::kYes,
2260 if (layer) {
2261 this->topDevice()->drawImageRect(image, &src, dst, sampling, layer->paint(), constraint);
2273 auto layer = this->aboutToDraw(this, realPaint, &dst);
2274 if (layer) {
2275 this->topDevice()->drawImageLattice(image, lattice, dst, filter, layer->paint());
2314 auto layer = this->aboutToDraw(this, paint, &bounds);
2315 if (layer) {
2316 this->topDevice()->drawGlyphRunList(glyphRunList, layer->paint());
2429 auto layer = this->aboutToDraw(this, simplePaint, &bounds);
2430 if (layer) {
2431 this->topDevice()->drawVertices(vertices, bmode, layer->paint());
2460 auto layer = this->aboutToDraw(this, simplePaint, &bounds);
2461 if (layer) {
2462 this->topDevice()->drawPatch(cubics, colors, texCoords, bmode, layer->paint());
2510 auto layer = this->aboutToDraw(this, realPaint);
2511 if (layer) {
2512 this->topDevice()->drawAtlas(xform, tex, colors, count, bmode, layer->paint());
2576 auto layer = this->aboutToDraw(this, realPaint, setBoundsValid ? &setBounds : nullptr);
2577 if (layer) {
2579 layer->paint(), constraint);