8 #ifndef GrRenderTarget_DEFINED
9 #define GrRenderTarget_DEFINED
11 #include "GrSurface.h"
15 class GrRenderTargetOpList;
16 class GrRenderTargetPriv;
17 class GrStencilAttachment;
33 bool isStencilBufferMultisampled()
const {
return fSampleCnt > 0; }
35 GrFSAAType fsaaType()
const {
37 SkASSERT(!(fFlags & GrRenderTargetFlags::kMixedSampled));
38 return GrFSAAType::kNone;
40 return (fFlags & GrRenderTargetFlags::kMixedSampled) ? GrFSAAType::kMixedSamples
41 : GrFSAAType::kUnifiedMSAA;
53 return GrFSAAType::kMixedSamples == this->fsaaType() ? 0 : fSampleCnt;
93 kCanResolve_ResolveType,
94 kAutoResolves_ResolveType,
95 kCantResolve_ResolveType,
97 virtual ResolveType getResolveType()
const = 0;
106 virtual bool canAttemptStencilAttachment()
const = 0;
109 GrRenderTargetPriv renderTargetPriv();
110 const GrRenderTargetPriv renderTargetPriv()
const;
114 GrRenderTargetFlags = GrRenderTargetFlags::kNone,
115 GrStencilAttachment* =
nullptr);
126 virtual bool completeStencilAttachment() = 0;
128 friend class GrRenderTargetPriv;
131 GrStencilAttachment* fStencilAttachment;
132 uint8_t fMultisampleSpecsID;
133 GrRenderTargetFlags fFlags;
Represents the capabilities of a GrContext.
Definition: GrCaps.h:24
Describes a surface to be created.
Definition: GrTypes.h:589
void overrideResolveRect(const SkIRect rect)
Call to override the region that needs to be resolved.
bool needsResolve() const
Definition: GrRenderTarget.h:82
Definition: GrSurface.h:21
bool isEmpty() const
Return true if the rectangle's width or height are <= 0.
Definition: SkRect.h:103
void onRelease() override
Overridden to free GPU resources in the backend API.
GrRenderTarget * asRenderTarget() override
Definition: GrRenderTarget.h:29
int numColorSamples() const
Returns the number of samples/pixel in the color buffer (Zero if non-MSAA or mixed sampled)...
Definition: GrRenderTarget.h:52
const SkIRect & getResolveRect() const
Returns a rect bounding the region needing resolving.
Definition: GrRenderTarget.h:87
virtual GrBackendObject getRenderTargetHandle() const =0
Return the native ID or handle to the rendertarget, depending on the platform.
GrRenderTarget represents a 2D buffer of pixels that can be rendered to.
Definition: GrRenderTarget.h:26
void onAbandon() override
Overridden to abandon any internal handles, ptrs, etc to backend API resources.
void flagAsResolved()
Call to indicate that GrRenderTarget was externally resolved.
Definition: GrRenderTarget.h:77
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
void flagAsNeedingResolve(const SkIRect *rect=NULL)
Call to indicate the multisample contents were modified such that the render target needs to be resol...
int numStencilSamples() const
Returns the number of samples/pixel in the stencil buffer (Zero if non-MSAA).
Definition: GrRenderTarget.h:47
void setLargestInverted()
Make the largest representable rectangle, but inverted (e.g.
Definition: SkRect.h:157