8 #ifndef SkSurface_DEFINED
9 #define SkSurface_DEFINED
13 #include "SkSurfaceProps.h"
51 void (*releaseProc)(
void* pixels,
void* context),
70 return MakeRaster(info, 0, props);
99 GrSurfaceOrigin origin,
int sampleCnt,
114 GrSurfaceOrigin origin,
131 GrSurfaceOrigin origin,
142 return MakeFromBackendTexture(ctx, desc,
nullptr, props);
148 return MakeFromBackendRenderTarget(ctx, desc,
nullptr, props);
153 return MakeFromBackendTextureAsRenderTarget(ctx, desc,
nullptr, props);
162 int sampleCount, GrSurfaceOrigin,
168 return MakeRenderTarget(context, budgeted, info, sampleCount,
169 kBottomLeft_GrSurfaceOrigin, props);
173 if (!info.width() || !info.height()) {
176 return MakeRenderTarget(gr, b, info, 0, kBottomLeft_GrSurfaceOrigin,
nullptr);
179 int width()
const {
return fWidth; }
180 int height()
const {
return fHeight; }
191 uint32_t generationID();
215 void notifyContentWillChange(ContentChangeMode mode);
226 static const BackendHandleAccess kFlushRead_TextureHandleAccess =
227 kFlushRead_BackendHandleAccess;
228 static const BackendHandleAccess kFlushWrite_TextureHandleAccess =
229 kFlushWrite_BackendHandleAccess;
230 static const BackendHandleAccess kDiscardWrite_TextureHandleAccess =
231 kDiscardWrite_BackendHandleAccess;
241 GrBackendObject getTextureHandle(BackendHandleAccess);
249 bool getRenderTargetHandle(GrBackendObject*, BackendHandleAccess);
320 bool readPixels(
const SkImageInfo& dstInfo,
void* dstPixels,
size_t dstRowBytes,
331 void prepareForExternalIO();
349 bool flushAndSignalSemaphores(
int numSemaphores,
GrBackendSemaphore* signalSemaphores);
366 void dirtyGenerationID() {
374 uint32_t fGenerationID;
A Canvas encapsulates all of the state about drawing into a device (bitmap).
Definition: SkCanvas.h:59
Definition: GrTypes.h:679
Definition: GrBackendSurface.h:67
Describe an image's dimensions and pixel type.
Definition: SkImageInfo.h:181
Describes properties and constraints of a given SkSurface.
Definition: SkSurfaceProps.h:51
Pairs SkImageInfo with actual pixels and rowbytes.
Definition: SkPixmap.h:23
SkSurface is responsible for managing the pixels that a canvas draws into.
Definition: SkSurface.h:32
static sk_sp< SkSurface > MakeRaster(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
Allocate a new surface, automatically computing the rowBytes.
Definition: SkSurface.h:68
Definition: SkRefCnt.h:125
Gr can wrap an existing render target created by the client in the 3D API with a GrRenderTarget objec...
Definition: GrTypes.h:711
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
Definition: GrBackendSurface.h:18
caller must over-write the entire backend object
Definition: SkSurface.h:220
Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object...
Definition: GrBackendSemaphore.h:22
static SkImageInfo MakeN32Premul(int width, int height, sk_sp< SkColorSpace > cs=nullptr)
Sets colortype to the native ARGB32 type, and the alphatype to premul.
Definition: SkImageInfo.h:212
static sk_sp< SkSurface > MakeFromBackendTexture(GrContext *ctx, const GrBackendTextureDesc &desc, const SkSurfaceProps *props)
Legacy versions of the above factories, without color space support.
Definition: SkSurface.h:140
static sk_sp< SkSurface > MakeRasterN32Premul(int width, int height, const SkSurfaceProps *props=nullptr)
Helper version of NewRaster.
Definition: SkSurface.h:78
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:246
ContentChangeMode
Modes that can be passed to notifyContentWillChange.
Definition: SkSurface.h:196
Definition: GrContext.h:47
Use this mode if prior surface contents need to be preserved or if in doubt.
Definition: SkSurface.h:206
caller may read from the backend object
Definition: SkSurface.h:218
Use this mode if it is known that the upcoming content changes will clear or overwrite prior contents...
Definition: SkSurface.h:201
GrRenderTarget represents a 2D buffer of pixels that can be rendered to.
Definition: GrRenderTarget.h:26
caller may write to the backend object
Definition: SkSurface.h:219
BackendHandleAccess
Definition: SkSurface.h:217