| Index: src/gpu/GrPipeline.h
|
| diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
|
| index 4f81ae40d0276223f2de88d4edd3238ea3576ebf..833228f24675c6b3a89aa5c7b48f3a63d6c65993 100644
|
| --- a/src/gpu/GrPipeline.h
|
| +++ b/src/gpu/GrPipeline.h
|
| @@ -145,6 +145,7 @@ public:
|
|
|
| bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); }
|
| bool snapVerticesToPixelCenters() const { return SkToBool(fFlags & kSnapVertices_Flag); }
|
| + bool hasSampleLocations() const { return SkToBool(fFlags & kSampleLocations_Flag); }
|
|
|
| GrXferBarrierType xferBarrierType(const GrCaps& caps) const {
|
| return this->getXferProcessor().xferBarrierType(fRenderTarget.get(), caps);
|
| @@ -163,6 +164,28 @@ public:
|
| bool readsFragPosition() const { return fReadsFragPosition; }
|
| bool ignoresCoverage() const { return fIgnoresCoverage; }
|
|
|
| + ///////////////////////////////////////////////////////////////////////////
|
| +
|
| + /**
|
| + * Returns the actual number of samples the hardware will run when using this pipeline.
|
| + * NOTE: this can be greater than the sample count in the render target's surface descriptor.
|
| + */
|
| + int effectiveSampleCount() const { return this->getMultisampleSpecs().fEffectiveSampleCnt; }
|
| +
|
| + /**
|
| + * Returns a unique ID that identifies this pipeline's sample pattern, or 0 if sample locations
|
| + * are not supported.
|
| + */
|
| + uint16_t getSamplePatternID() const { return this->getMultisampleSpecs().fSamplePatternID; }
|
| +
|
| + /**
|
| + * Returns this pipeline's sample locations, or nullptr if sample locations are not supported.
|
| + * The sample locations are stored in device space, with the center of the pixel at [0.5, 0.5].
|
| + */
|
| + const SkPoint* getSampleLocations() const {
|
| + return this->getMultisampleSpecs().fSampleLocations;
|
| + }
|
| +
|
| private:
|
| GrPipeline() { /** Initialized in factory function*/ }
|
|
|
| @@ -184,9 +207,15 @@ private:
|
| void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFlags,
|
| const GrCaps&);
|
|
|
| + const GrRenderTargetPriv::MultisampleSpecs& getMultisampleSpecs() const {
|
| + SkASSERT(this->isHWAntialiasState());
|
| + return this->getRenderTarget()->renderTargetPriv().getMultisampleSpecs(fStencilSettings);
|
| + }
|
| +
|
| enum Flags {
|
| kHWAA_Flag = 0x1,
|
| kSnapVertices_Flag = 0x2,
|
| + kSampleLocations_Flag = 0x4,
|
| };
|
|
|
| typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
|
|
|