Flutter Engine
The Flutter Engine
|
#include <SkSurface_Base.h>
Public Types | |
enum class | Type { kNull , kGanesh , kGraphite , kRaster } |
Public Types inherited from SkSurface | |
enum | ContentChangeMode { kDiscard_ContentChangeMode , kRetain_ContentChangeMode } |
enum class | BackendHandleAccess { kFlushRead , kFlushWrite , kDiscardWrite , kFlushRead_BackendHandleAccess = kFlushRead , kFlushWrite_BackendHandleAccess = kFlushWrite , kDiscardWrite_BackendHandleAccess = kDiscardWrite } |
using | ReleaseContext = void * |
using | TextureReleaseProc = void(*)(ReleaseContext) |
using | AsyncReadResult = SkImage::AsyncReadResult |
using | ReadPixelsContext = void * |
using | ReadPixelsCallback = void(ReadPixelsContext, std::unique_ptr< const AsyncReadResult >) |
using | RescaleGamma = SkImage::RescaleGamma |
using | RescaleMode = SkImage::RescaleMode |
Friends | |
class | SkCanvas |
class | SkSurface |
Additional Inherited Members | |
Static Public Attributes inherited from SkSurface | |
static constexpr BackendHandleAccess | kFlushRead_BackendHandleAccess |
static constexpr BackendHandleAccess | kFlushWrite_BackendHandleAccess |
static constexpr BackendHandleAccess | kDiscardWrite_BackendHandleAccess |
Protected Member Functions inherited from SkSurface | |
SkSurface (int width, int height, const SkSurfaceProps *surfaceProps) | |
SkSurface (const SkImageInfo &imageInfo, const SkSurfaceProps *surfaceProps) | |
void | dirtyGenerationID () |
Definition at line 38 of file SkSurface_Base.h.
|
strong |
Enumerator | |
---|---|
kNull | |
kGanesh | |
kGraphite | |
kRaster |
Definition at line 53 of file SkSurface_Base.h.
SkSurface_Base::SkSurface_Base | ( | int | width, |
int | height, | ||
const SkSurfaceProps * | props | ||
) |
Definition at line 32 of file SkSurface_Base.cpp.
SkSurface_Base::SkSurface_Base | ( | const SkImageInfo & | info, |
const SkSurfaceProps * | props | ||
) |
Definition at line 35 of file SkSurface_Base.cpp.
|
override |
Definition at line 38 of file SkSurface_Base.cpp.
|
inline |
Definition at line 192 of file SkSurface_Base.h.
|
inline |
Definition at line 172 of file SkSurface_Base.h.
|
inline |
Definition at line 68 of file SkSurface_Base.h.
|
inline |
Definition at line 70 of file SkSurface_Base.h.
|
inline |
Definition at line 66 of file SkSurface_Base.h.
uint32_t SkSurface_Base::newGenerationID | ( | ) |
Definition at line 127 of file SkSurface_Base.cpp.
|
virtual |
Default implementation does a rescale/read and then calls the callback.
Reimplemented in skgpu::graphite::Surface, and SkSurface_Ganesh.
Definition at line 57 of file SkSurface_Base.cpp.
|
virtual |
Default implementation does a rescale/read/yuv conversion and then calls the callback.
Reimplemented in SkSurface_Ganesh, and skgpu::graphite::Surface.
Definition at line 82 of file SkSurface_Base.cpp.
|
virtual |
Reimplemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkNullSurface, and SkSurface_Raster.
Definition at line 133 of file SkSurface_Base.cpp.
|
inlinevirtual |
Reimplemented in SkSurface_Ganesh.
Definition at line 162 of file SkSurface_Base.h.
|
pure virtual |
If the surface is about to change, we call this so that our subclass can optionally fork their backend (copy-on-write) in case it was being shared with the cachedImage.
Returns false if the backing cannot be un-shared.
Implemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkNullSurface, and SkSurface_Raster.
|
inlinevirtual |
Called as a performance hint when the Surface is allowed to make it's contents undefined.
Reimplemented in SkSurface_Ganesh.
Definition at line 135 of file SkSurface_Base.h.
|
virtual |
Default implementation:
image = this->newImageSnapshot(); if (image) { image->draw(canvas, ...); image->unref(); }
Reimplemented in SkNullSurface, SkSurface_Raster, and SkSurface_Ganesh.
Definition at line 49 of file SkSurface_Base.cpp.
|
virtual |
Reimplemented in skgpu::graphite::Surface.
Definition at line 47 of file SkSurface_Base.cpp.
|
virtual |
Reimplemented in SkSurface_Ganesh.
Definition at line 45 of file SkSurface_Base.cpp.
|
inlinevirtual |
Reimplemented in SkSurface_Ganesh.
Definition at line 163 of file SkSurface_Base.h.
|
pure virtual |
Allocate a canvas that will draw into this surface. We will cache this canvas, to return the same object to the caller multiple times. We take ownership, and will call unref() on the canvas when we go out of scope.
Implemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkNullSurface, and SkSurface_Raster.
|
inlinevirtual |
Allocate an SkImage that represents the current contents of the surface. This needs to be able to outlive the surface itself (if need be), and must faithfully represent the current contents, even if the surface is changed after this called (e.g. it is drawn to via its canvas).
If a subset is specified, the the impl must make a copy, rather than try to wait on copy-on-write.
Reimplemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkSurface_Raster, and SkNullSurface.
Definition at line 94 of file SkSurface_Base.h.
|
pure virtual |
Implemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkSurface_Raster, and SkNullSurface.
|
inlinevirtual |
Signal the surface to remind its backing store that it's mutable again. Called only when we didn't copy-on-write; we assume the copies start mutable.
Reimplemented in SkSurface_Raster.
Definition at line 150 of file SkSurface_Base.h.
|
inlinevirtual |
Caused the current backend 3D API to wait on the passed in semaphores before executing new commands on the gpu. Any previously submitting commands will not be blocked by these semaphores.
Reimplemented in SkSurface_Ganesh.
Definition at line 157 of file SkSurface_Base.h.
Implemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkNullSurface, and SkSurface_Raster.
Definition at line 202 of file SkSurface_Base.h.
|
inlineoverridevirtual |
If the surface was made via MakeFromBackendTexture then it's backing texture may be substituted with a different texture. The contents of the previous backing texture are copied into the new texture. SkCanvas state is preserved. The original sample count is used. The GrBackendFormat and dimensions of replacement texture must match that of the original.
Upon success textureReleaseProc is called when it is safe to delete the texture in the backend API (accounting only for use of the texture by this surface). If SkSurface creation fails textureReleaseProc is called before this function returns.
backendTexture | the new backing texture for the surface |
mode | Retain or discard current Content |
TextureReleaseProc | function called when texture can be released |
ReleaseContext | state passed to textureReleaseProc |
Implements SkSurface.
Definition at line 45 of file SkSurface_Base.h.
|
inlinevirtual |
Reimplemented in SkSurface_Ganesh, skgpu::graphite::Surface, SkNullSurface, and SkSurface_Raster.
Definition at line 63 of file SkSurface_Base.h.
|
friend |
Definition at line 188 of file SkSurface_Base.h.
|
friend |
Definition at line 189 of file SkSurface_Base.h.