Lines Matching refs:device

197 SkCanvas::Layer::Layer(sk_sp<SkBaseDevice> device,
200 : fDevice(std::move(device))
206 // can be used as-is to draw the result of the filter to the dst device.
210 SkCanvas::MCRec::MCRec(SkBaseDevice* device) : fDevice(device) {
230 void SkCanvas::MCRec::reset(SkBaseDevice* device) {
232 SkASSERT(device);
234 fDevice = device;
242 // modifies the device's clip.
388 // know that the device is a SkNoPixelsDevice.
395 void SkCanvas::init(sk_sp<SkBaseDevice> device) {
401 if (!device) {
402 device = sk_make_sp<SkNoPixelsDevice>(SkIRect::MakeEmpty(), fProps);
405 // From this point on, SkCanvas will always have a device
406 SkASSERT(device);
409 fMCRec = new (fMCStack.push_back()) MCRec(device.get());
412 // The root device and the canvas should always have the same pixel geometry
413 SkASSERT(fProps.pixelGeometry() == device->surfaceProps().pixelGeometry());
414 device->setMarkerStack(fMarkerStack.get());
417 fBaseDevice = std::move(device);
443 SkCanvas::SkCanvas(sk_sp<SkBaseDevice> device)
445 , fProps(device->surfaceProps()) {
448 this->init(device);
455 sk_sp<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps, nullptr, nullptr));
456 this->init(device);
466 sk_sp<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps, hndl, nullptr));
467 this->init(device);
479 sk_sp<SkBaseDevice> device(new SkBitmapDevice(tmp, fProps, nullptr, nullptr));
480 this->init(device);
556 SkBaseDevice* device = this->baseDevice();
561 if (!srcRect.intersect({0, 0, device->width(), device->height()})) {
566 const bool completeOverwrite = srcRect.size() == device->imageInfo().dimensions();
575 return device->writePixels({srcInfo, pixels, rowBytes}, x, y);
699 // Will use the inverse and center of the device bounds if the content bounds aren't provided.
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
750 // its resolution adjusted in comparison to the final device).
758 // be 2X larger per side of the prior device in order to fully cover it. We use the max of that
838 // 'filter' sees the src device's buffer as the implicit input image, and processes the image
839 // in this device space (referred to as the "layer" space). However, the filter
860 // Compute the image filter mapping by decomposing the local->device matrix of dst and
869 // The above mapping transforms from local to dst's device space, where the layer space
892 // The src device can be snapped directly
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).
1015 // black and should cover the device.
1034 // device's coordinate space.
1048 // Size the new layer relative to the prior device, which may already be aligned for filters.
1059 // The filtered content would not draw anything, or the new device space has an invalid
1060 // coordinate system, in which case we mark the current top device as empty so that nothing
1105 // Configure device to match determined mapping for any image filters.
1106 // The setDeviceCoordinateSystem applies the prior device's global transform since
1115 // mapping until being combined with the previous device-to-global matrix, at which point
1127 // The new device was constructed to be compatible with 'filter', not necessarily
1128 // 'rec.fBackdrop', so allow DrawDeviceWithFilter to transform the prior device contents
1157 SkBaseDevice* device = this->topDevice();
1159 // Map the local bounds into the top device's coordinate space (this is not
1164 device->localToDevice().mapRect(&tmp, *localBounds);
1165 if (!devBounds.intersect(tmp.round(), device->devClipBounds())) {
1169 devBounds = device->devClipBounds();
1175 // This is getting the special image from the current device, which is then drawn into (both by
1177 // own device, we need to explicitly copy the back image contents so that its original content
1179 auto backImage = device->snapSpecial(devBounds, /* copy */ true);
1225 // Draw the layer's device contents into the now-current older device. We can't call public
1230 // Don't go through AutoLayerForImageFilter since device draws are so closely tied to
1255 // Update the quick-reject bounds in case the restore changed the top device or the
1312 // be axis-aligned with the root canvas. If the top level device isn't axis aligned, that's
1446 // The device clip restriction is a surface-space rectangular intersection that cannot be
1457 // device; any other device for a saved layer will be clipped back to the base device during its
1460 // we've restored past that point to keep our state in sync with the device's clip stack.
1461 // - We assert that we're on the base device when this is invoked.
1466 // partially since the device's clips wasn't adjusted. Resetting is now handled
1481 // device's current transform first.
1494 // Respect the device clip restriction when resetting the clip if we're on the base device.
1495 // If we're not on the base device, then the "reset" applies to the top device's clip stack,
1604 SkBaseDevice* device = this->topDevice();
1605 if (device && device->isPixelAlignedToGlobal()) {
1606 device->onAsRgnClip(rgn);
1607 SkIPoint origin = device->getOrigin();
2052 // The backimage location (and thus bounds) were defined in the device's space, so mark it
2057 // We also have to temporarily whack the device matrix since clipRegion is affected by the
2058 // global-to-device matrix and clipRect is affected by the local-to-device.
2061 // ~adtr will reset the local-to-device matrix so that drawPaint() shades correctly.
2178 // quick bounds have been outset by 1px compared to overall device bounds, so this makes the
2179 // contains check equivalent to between ir and device bounds
2218 SkBaseDevice* device = this->topDevice();
2220 if ((special = device->makeSpecial(image))) {
2230 SkMatrix layerToDevice = device->localToDevice();
2235 device->drawFilteredImage(mapping, special.get(), filter.get(), sampling,realPaint);
2725 SkNoDrawCanvas::SkNoDrawCanvas(sk_sp<SkBaseDevice> device)
2726 : INHERITED(device) {}