Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: include/gpu/GrRenderTarget.h

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrTypes.h » ('j') | include/gpu/GrTypes.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | include/gpu/GrTypes.h » ('j') | include/gpu/GrTypes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698