Lines Matching defs:SkSurface
41 /** \class SkSurface
42 SkSurface is responsible for managing the pixels that a canvas draws into. The pixels can be
44 SkSurface takes care of allocating a SkCanvas that will draw into the surface. Call
46 SkSurface always has non-zero dimensions. If there is a request for a new surface, and either
49 class SK_API SkSurface : public SkRefCnt {
52 /** Allocates raster SkSurface. SkCanvas returned by SkSurface draws directly into pixels.
54 SkSurface is returned if all parameters are valid.
68 @param rowBytes interval from one SkSurface row to the next
71 @return SkSurface if all parameters are valid; otherwise, nullptr
73 static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo& imageInfo, void* pixels,
77 static sk_sp<SkSurface> MakeRasterDirect(const SkPixmap& pm,
82 /** Allocates raster SkSurface. SkCanvas returned by SkSurface draws directly into pixels.
83 releaseProc is called with pixels and context when SkSurface is deleted.
85 SkSurface is returned if all parameters are valid.
99 @param rowBytes interval from one SkSurface row to the next
100 @param releaseProc called when SkSurface is deleted; may be nullptr
104 @return SkSurface if all parameters are valid; otherwise, nullptr
106 static sk_sp<SkSurface> MakeRasterDirectReleaseProc(const SkImageInfo& imageInfo, void* pixels,
111 /** Allocates raster SkSurface. SkCanvas returned by SkSurface draws directly into pixels.
114 Pixel memory is deleted when SkSurface is deleted.
116 SkSurface is returned if all parameters are valid.
126 @param rowBytes interval from one SkSurface row to the next; may be zero
129 @return SkSurface if all parameters are valid; otherwise, nullptr
131 static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, size_t rowBytes,
134 /** Allocates raster SkSurface. SkCanvas returned by SkSurface draws directly into pixels.
137 Pixel memory is deleted when SkSurface is deleted.
139 SkSurface is returned if all parameters are valid.
148 @return SkSurface if all parameters are valid; otherwise, nullptr
150 static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo,
155 /** Allocates raster SkSurface. SkCanvas returned by SkSurface draws directly into pixels.
157 four. Pixel memory is deleted when SkSurface is deleted.
162 SkSurface is returned if width and height are greater than zero.
164 Use to create SkSurface that matches SkPMColor, the native pixel arrangement on
165 the platform. SkSurface drawn to output device skips converting its pixel format.
171 @return SkSurface if all parameters are valid; otherwise, nullptr
173 static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height,
185 /** Wraps a GPU-backed texture into SkSurface. Caller must ensure the texture is
186 valid for the lifetime of returned SkSurface. If sampleCnt greater than zero,
187 creates an intermediate MSAA SkSurface which is used for drawing backendTexture.
189 SkSurface is returned if all parameters are valid. backendTexture is valid if
197 backend API (accounting only for use of the texture by this surface). If SkSurface creation
210 @return SkSurface if all parameters are valid; otherwise, nullptr
212 static sk_sp<SkSurface> MakeFromBackendTexture(GrRecordingContext* context,
221 /** Wraps a GPU-backed buffer into SkSurface. Caller must ensure backendRenderTarget
222 is valid for the lifetime of returned SkSurface.
224 SkSurface is returned if all parameters are valid. backendRenderTarget is valid if
232 backend API (accounting only for use of the render target by this surface). If SkSurface
244 @return SkSurface if all parameters are valid; otherwise, nullptr
246 static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrRecordingContext* context,
255 /** Returns SkSurface on GPU indicated by context. Allocates memory for
278 @param shouldCreateWithMips hint that SkSurface will host mip map images
279 @return SkSurface if all parameters are valid; otherwise, nullptr
281 static sk_sp<SkSurface> MakeRenderTarget(GrRecordingContext* context, SkBudgeted budgeted,
287 /** Returns SkSurface on GPU indicated by context. Allocates memory for
298 SkSurface bottom-left corner is pinned to the origin.
306 @return SkSurface if all parameters are valid; otherwise, nullptr
308 static sk_sp<SkSurface> MakeRenderTarget(GrRecordingContext* context, SkBudgeted budgeted,
320 /** Returns SkSurface on GPU indicated by context. Allocates memory for
326 SkSurface bottom-left corner is pinned to the origin.
331 @return SkSurface if all parameters are valid; otherwise, nullptr
333 static sk_sp<SkSurface> MakeRenderTarget(GrRecordingContext* context, SkBudgeted budgeted,
347 /** Returns SkSurface on GPU indicated by context that is compatible with the provided
351 @param characterization description of the desired SkSurface
352 @return SkSurface if all parameters are valid; otherwise, nullptr
354 static sk_sp<SkSurface> MakeRenderTarget(GrRecordingContext* context,
361 Creates SkSurface from Android hardware buffer.
362 Returned SkSurface takes a reference on the buffer. The ref on the buffer will be released
363 when the SkSurface is destroyed and there is no pending work on the GPU involving the
377 @return created SkSurface, or nullptr
379 static sk_sp<SkSurface> MakeFromAHardwareBuffer(GrDirectContext* context,
387 /** Creates SkSurface from CAMetalLayer.
388 Returned SkSurface takes a reference on the CAMetalLayer. The ref on the layer will be
389 released when the SkSurface is destroyed.
404 @return created SkSurface, or nullptr
406 static sk_sp<SkSurface> MakeFromCAMetalLayer(GrRecordingContext* context,
416 /** Creates SkSurface from MTKView.
417 Returned SkSurface takes a reference on the MTKView. The ref on the layer will be
418 released when the SkSurface is destroyed.
431 @return created SkSurface, or nullptr
433 static sk_sp<SkSurface> MakeFromMTKView(GrRecordingContext* context,
445 This method can be used to determine if an existing SkSurface is a viable destination
454 /** Returns SkSurface without backing pixels. Drawing to SkCanvas returned from SkSurface
455 has no effect. Calling makeImageSnapshot() on returned SkSurface returns nullptr.
459 @return SkSurface if width and height are positive; otherwise, nullptr
463 static sk_sp<SkSurface> MakeNull(int width, int height);
481 /** Returns unique value identifying the content of SkSurface. Returned value changes
491 /** \enum SkSurface::ContentChangeMode
499 /** Notifies that SkSurface contents will be changed by code outside of Skia.
508 /** Returns the recording context being used by the SkSurface.
536 /** Retrieves the back-end texture. If SkSurface has no back-end texture, an invalid
540 The returned GrBackendTexture should be discarded if the SkSurface is drawn to or deleted.
546 /** Retrieves the back-end render target. If SkSurface has no back-end render target, an invalid
550 The returned GrBackendRenderTarget should be discarded if the SkSurface is drawn to
564 backend API (accounting only for use of the texture by this surface). If SkSurface creation
579 /** Returns SkCanvas that draws into SkSurface. Subsequent calls return the same SkCanvas.
580 SkCanvas returned is managed and owned by SkSurface, and is deleted when SkSurface
583 @return drawing SkCanvas for SkSurface
589 /** Returns a compatible SkSurface, or nullptr. Returned SkSurface contains
590 the same raster, GPU, or null properties as the original. Returned SkSurface
594 is incompatible with SkSurface.
597 of SkSurface; width and height must be greater than zero
598 @return compatible SkSurface or nullptr
602 sk_sp<SkSurface> makeSurface(const SkImageInfo& imageInfo);
607 sk_sp<SkSurface> makeSurface(int width, int height);
609 /** Returns SkImage capturing SkSurface contents. Subsequent drawing to SkSurface contents
610 are not captured. SkImage allocation is accounted for if SkSurface was created with
613 @return SkImage initialized with SkSurface contents
632 /** Draws SkSurface contents to canvas, with its top-left corner at (x, y).
652 /** Copies SkSurface pixel address, row bytes, and SkImageInfo to SkPixmap, if address
656 pixmap contents become invalid on any future change to SkSurface.
659 @return true if SkSurface has direct access to pixels
667 Source SkRect corners are (srcX, srcY) and SkSurface (width(), height()).
672 Pixels are readable when SkSurface is raster, or backed by a GPU.
687 @param dst storage for pixels copied from SkSurface
698 Source SkRect corners are (srcX, srcY) and SkSurface (width(), height()).
703 Pixels are readable when SkSurface is raster, or backed by a GPU.
715 - SkSurface pixels could not be converted to dstInfo.colorType() or dstInfo.alphaType().
728 /** Copies SkRect of pixels from SkSurface into bitmap.
730 Source SkRect corners are (srcX, srcY) and SkSurface (width(), height()).
735 Pixels are readable when SkSurface is raster, or backed by a GPU.
747 - SkSurface pixels could not be converted to dst.colorType() or dst.alphaType().
751 @param dst storage for pixels copied from SkSurface
795 SkSurface is GPU-backed the data is immediately invalidated if the context is abandoned
828 SkSurface is GPU-backed the data is immediately invalidated if the context is abandoned
851 /** Copies SkRect of pixels from the src SkPixmap to the SkSurface.
858 converting to SkSurface colorType() and SkSurface alphaType() if required.
860 @param src storage for pixels to copy to SkSurface
861 @param dstX x-axis position relative to SkSurface to begin copy; may be negative
862 @param dstY y-axis position relative to SkSurface to begin copy; may be negative
868 /** Copies SkRect of pixels from the src SkBitmap to the SkSurface.
875 converting to SkSurface colorType() and SkSurface alphaType() if required.
877 @param src storage for pixels to copy to SkSurface
878 @param dstX x-axis position relative to SkSurface to begin copy; may be negative
879 @param dstY y-axis position relative to SkSurface to begin copy; may be negative
896 calling SkSurface::flush with a default GrFlushInfo followed by
907 /** Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface
924 SkSurface will be transferred back to its original queue. If the SkSurface was created by
953 /** Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface
1026 Return true if SkSurface supports characterization. raster surface returns false.
1036 If the deferred display list is not compatible with this SkSurface, the draw is skipped
1062 SkSurface(int width, int height, const SkSurfaceProps* surfaceProps);
1063 SkSurface(const SkImageInfo& imageInfo, const SkSurfaceProps* surfaceProps);