Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkSpecialImage_Gpu Class Referencefinal
Inheritance diagram for SkSpecialImage_Gpu:
SkSpecialImage SkRefCnt SkRefCntBase

Public Member Functions

 SkSpecialImage_Gpu (GrRecordingContext *context, const SkIRect &subset, uint32_t uniqueID, GrSurfaceProxyView view, const SkColorInfo &colorInfo, const SkSurfaceProps &props)
 
size_t getSize () const override
 
bool isGaneshBacked () const override
 
GrRecordingContextgetContext () const override
 
GrSurfaceProxyView view (GrRecordingContext *) const
 
SkISize backingStoreDimensions () const override
 
sk_sp< SkSpecialImageonMakeBackingStoreSubset (const SkIRect &subset) const override
 
sk_sp< SkImageasImage () const override
 
- Public Member Functions inherited from SkSpecialImage
const SkSurfacePropsprops () const
 
int width () const
 
int height () const
 
SkISize dimensions () const
 
const SkIRectsubset () const
 
uint32_t uniqueID () const
 
virtual SkISize backingStoreDimensions () const =0
 
virtual size_t getSize () const =0
 
bool isExactFit () const
 
const SkColorInfocolorInfo () const
 
SkAlphaType alphaType () const
 
SkColorType colorType () const
 
SkColorSpacegetColorSpace () const
 
void draw (SkCanvas *canvas, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint, bool strict=true) const
 
void draw (SkCanvas *canvas, SkScalar x, SkScalar y) const
 
sk_sp< SkSpecialImagemakeSubset (const SkIRect &subset) const
 
sk_sp< SkSpecialImagemakePixelOutset () const
 
virtual sk_sp< SkImageasImage () const =0
 
virtual sk_sp< SkShaderasShader (SkTileMode, const SkSamplingOptions &, const SkMatrix &lm, bool strict=true) const
 
virtual bool isGaneshBacked () const
 
virtual bool isGraphiteBacked () const
 
virtual GrRecordingContextgetContext () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Public Types inherited from SkSpecialImage
typedef void * ReleaseContext
 
typedef void(* RasterReleaseProc) (void *pixels, ReleaseContext)
 
- Protected Member Functions inherited from SkSpecialImage
 SkSpecialImage (const SkIRect &subset, uint32_t uniqueID, const SkColorInfo &, const SkSurfaceProps &)
 
virtual sk_sp< SkSpecialImageonMakeBackingStoreSubset (const SkIRect &subset) const =0
 

Detailed Description

Definition at line 31 of file SkSpecialImage_Ganesh.cpp.

Constructor & Destructor Documentation

◆ SkSpecialImage_Gpu()

SkSpecialImage_Gpu::SkSpecialImage_Gpu ( GrRecordingContext context,
const SkIRect subset,
uint32_t  uniqueID,
GrSurfaceProxyView  view,
const SkColorInfo colorInfo,
const SkSurfaceProps props 
)
inline

Definition at line 33 of file SkSpecialImage_Ganesh.cpp.

40 , fContext(context)
41 , fView(std::move(view)) {}
GrSurfaceProxyView view(GrRecordingContext *) const
uint32_t uniqueID() const
SkSpecialImage(const SkIRect &subset, uint32_t uniqueID, const SkColorInfo &, const SkSurfaceProps &)
const SkIRect & subset() const
const SkSurfaceProps & props() const
const SkColorInfo & colorInfo() const

Member Function Documentation

◆ asImage()

sk_sp< SkImage > SkSpecialImage_Gpu::asImage ( ) const
inlineoverridevirtual

Create an SkImage view of the contents of this special image, pointing to the same underlying memory.

TODO: If SkImages::MakeFiltered were to return an SkShader that accounted for the subset constraint and offset, then this could move to a private virtual for use in draw() and asShader().

Implements SkSpecialImage.

Definition at line 60 of file SkSpecialImage_Ganesh.cpp.

60 {
61 fView.proxy()->priv().exactify();
62 return sk_make_sp<SkImage_Ganesh>(
63 sk_ref_sp(fContext), this->uniqueID(), fView, this->colorInfo());
64 }
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
GrSurfaceProxy * proxy() const
GrSurfaceProxyPriv priv()

◆ backingStoreDimensions()

SkISize SkSpecialImage_Gpu::backingStoreDimensions ( ) const
inlineoverridevirtual

Implements SkSpecialImage.

Definition at line 51 of file SkSpecialImage_Ganesh.cpp.

51 {
52 return fView.proxy()->backingStoreDimensions();
53 }
SkISize backingStoreDimensions() const

◆ getContext()

GrRecordingContext * SkSpecialImage_Gpu::getContext ( ) const
inlineoverridevirtual

Return the GrRecordingContext if the SkSpecialImage is GrTexture-backed

Reimplemented from SkSpecialImage.

Definition at line 47 of file SkSpecialImage_Ganesh.cpp.

47{ return fContext; }

◆ getSize()

size_t SkSpecialImage_Gpu::getSize ( ) const
inlineoverridevirtual

Implements SkSpecialImage.

Definition at line 43 of file SkSpecialImage_Ganesh.cpp.

43{ return fView.proxy()->gpuMemorySize(); }
size_t gpuMemorySize() const

◆ isGaneshBacked()

bool SkSpecialImage_Gpu::isGaneshBacked ( ) const
inlineoverridevirtual

If the SpecialImage is backed by a gpu texture, return true.

Reimplemented from SkSpecialImage.

Definition at line 45 of file SkSpecialImage_Ganesh.cpp.

45{ return true; }

◆ onMakeBackingStoreSubset()

sk_sp< SkSpecialImage > SkSpecialImage_Gpu::onMakeBackingStoreSubset ( const SkIRect subset) const
inlineoverridevirtual

Implements SkSpecialImage.

Definition at line 55 of file SkSpecialImage_Ganesh.cpp.

55 {
57 fContext, subset, this->uniqueID(), fView, this->colorInfo(), this->props());
58 }
sk_sp< SkSpecialImage > MakeDeferredFromGpu(GrRecordingContext *context, const SkIRect &subset, uint32_t uniqueID, GrSurfaceProxyView view, const GrColorInfo &colorInfo, const SkSurfaceProps &props)

◆ view()

GrSurfaceProxyView SkSpecialImage_Gpu::view ( GrRecordingContext ) const
inline

Definition at line 49 of file SkSpecialImage_Ganesh.cpp.

49{ return fView; }

The documentation for this class was generated from the following file: