Chromium Code Reviews| Index: include/gpu/GrRenderTarget.h |
| diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h |
| index 40e006aa8aec8edb70b28cec5a3274f5b7f0e110..d77d29ba87e4a1f595b6783c96aa15279217023d 100644 |
| --- a/include/gpu/GrRenderTarget.h |
| +++ b/include/gpu/GrRenderTarget.h |
| @@ -31,14 +31,32 @@ public: |
| // GrRenderTarget |
| /** |
| - * @return true if the surface is multisampled, false otherwise |
| + * @param requestedConfig |
|
Chris Dalton
2015/03/14 02:51:30
Oops, sorry. I didn't finish my previous comment a
|
| + * @return true if the surface is multisampled in all of the buffers |
| + * specified by the sample config, false if any are non-MSAA |
| */ |
| - bool isMultisampled() const { return 0 != fDesc.fSampleCnt; } |
| + bool isMultisampled(GrSampleConfig requestedConfig = kUnified_GrSampleConfig) const { |
| + return 0 != numSamples(requestedConfig); |
| + } |
| /** |
| - * @return the number of samples-per-pixel or zero if non-MSAA. |
| + * @return the number of samples-per-pixel or zero if any of the specified |
| + * buffers is non-MSAA. |
| */ |
| - int numSamples() const { return fDesc.fSampleCnt; } |
| + int numSamples(GrSampleConfig requestedConfig = kUnified_GrSampleConfig) const { |
| + if (kStencil_GrSampleConfig == fSampleConfig && |
| + kUnified_GrSampleConfig == requestedConfig) { |
| + return 0; |
| + } |
| + return fDesc.fSampleCnt; |
| + } |
| + |
| + /** |
| + * @return sample config. |
| + */ |
| + GrSampleConfig sampleConfig() { |
| + return fSampleConfig; |
| + } |
| /** |
| * Call to indicate the multisample contents were modified such that the |
| @@ -94,8 +112,10 @@ public: |
| const GrRenderTargetPriv renderTargetPriv() const; |
| protected: |
| - GrRenderTarget(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc) |
| + GrRenderTarget(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc, |
| + GrSampleConfig sampleConfig) |
| : INHERITED(gpu, lifeCycle, desc) |
| + , fSampleConfig(sampleConfig) |
| , fStencilBuffer(NULL) { |
| fResolveRect.setLargestInverted(); |
| } |
| @@ -110,6 +130,8 @@ private: |
| friend class GrRenderTargetPriv; |
| + GrSampleConfig fSampleConfig; |
| + |
| GrStencilBuffer* fStencilBuffer; |
| SkIRect fResolveRect; |