8 #ifndef GrRenderTarget_DEFINED
9 #define GrRenderTarget_DEFINED
11 #include "GrSurface.h"
16 class GrStencilAttachment;
17 class GrRenderTargetPriv;
33 bool isStencilBufferMultisampled()
const {
return fDesc.
fSampleCnt > 0; }
99 kCanResolve_ResolveType,
100 kAutoResolves_ResolveType,
101 kCantResolve_ResolveType,
103 virtual ResolveType getResolveType()
const = 0;
112 virtual bool canAttemptStencilAttachment()
const = 0;
115 GrRenderTargetPriv renderTargetPriv();
116 const GrRenderTargetPriv renderTargetPriv()
const;
118 void setLastDrawTarget(GrDrawTarget* dt);
119 GrDrawTarget* getLastDrawTarget() {
return fLastDrawTarget; }
124 kMixedSampled = 1 << 0,
125 kWindowRectsSupport = 1 << 1
128 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags);
131 GrStencilAttachment* =
nullptr);
143 virtual bool completeStencilAttachment() = 0;
145 friend class GrRenderTargetPriv;
147 GrStencilAttachment* fStencilAttachment;
148 uint8_t fMultisampleSpecsID;
159 GrDrawTarget* fLastDrawTarget;
164 GR_MAKE_BITFIELD_CLASS_OPS(GrRenderTarget::Flags);
Represents the capabilities of a GrContext.
Definition: GrCaps.h:130
bool isUnifiedMultisampled() const
"Unified Sampled" means the stencil and color buffers are both multisampled.
Definition: GrRenderTarget.h:44
Describes a surface to be created.
Definition: GrTypes.h:467
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:54
const SkIRect & getResolveRect() const
Returns a rect bounding the region needing resolving.
Definition: GrRenderTarget.h:87
void discard()
Provide a performance hint that the render target's contents are allowed to become undefined...
int fSampleCnt
The number of samples per pixel or 0 to disable full scene AA.
Definition: GrTypes.h:496
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
bool isMixedSampled() const
For our purposes, "Mixed Sampled" means the stencil buffer is multisampled but the color buffer is no...
Definition: GrRenderTarget.h:39
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:49
void setLargestInverted()
Make the largest representable rectangle, but inverted (e.g.
Definition: SkRect.h:157