Chromium Code Reviews| Index: include/gpu/GrRenderTarget.h |
| diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h |
| index 40e006aa8aec8edb70b28cec5a3274f5b7f0e110..997439b1a6086f6a00cf17deecefc27d7118df07 100644 |
| --- a/include/gpu/GrRenderTarget.h |
| +++ b/include/gpu/GrRenderTarget.h |
| @@ -33,12 +33,27 @@ public: |
| /** |
| * @return true if the surface is multisampled, false otherwise |
| */ |
|
Chris Dalton
2015/03/12 07:43:35
Comment may need some work.
@param requestedConfi
vbuzinov
2015/03/13 13:37:22
Done.
|
| - 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. |
|
Chris Dalton
2015/03/12 07:43:35
Comment:
@return the number of samples-per-pixel
vbuzinov
2015/03/13 13:37:22
Done.
|
| */ |
| - 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 +109,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 = kUnified_GrSampleConfig) |
|
Chris Dalton
2015/03/13 03:11:32
I don't think sampleConfig needs a default value.
vbuzinov
2015/03/13 13:37:22
Done.
|
| : INHERITED(gpu, lifeCycle, desc) |
| + , fSampleConfig(sampleConfig) |
| , fStencilBuffer(NULL) { |
| fResolveRect.setLargestInverted(); |
| } |
| @@ -110,6 +127,8 @@ private: |
| friend class GrRenderTargetPriv; |
| + GrSampleConfig fSampleConfig; |
| + |
| GrStencilBuffer* fStencilBuffer; |
| SkIRect fResolveRect; |