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

Unified Diff: include/gpu/GrCaps.h

Issue 1592803002: Differentiate maxColorSamples and maxStencilSamples in GrCaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updates Created 4 years, 11 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 | src/gpu/GrCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrCaps.h
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 679777f9ddc74caab3c3820d4258e371a0eeb003..e2e59c30a4c7701b1f85e3174262982c6f006484 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -122,7 +122,7 @@ public:
bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSupport; }
bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
- bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
+ bool usesMixedSamples() const { return fUsesMixedSamples; }
bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; }
bool useDrawInsteadOfPartialRenderTargetWrite() const {
@@ -188,7 +188,19 @@ public:
int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return fMaxTileSize; }
// Will be 0 if MSAA is not supported
- int maxSampleCount() const { return fMaxSampleCount; }
+ int maxColorSampleCount() const { return fMaxColorSampleCount; }
+ // Will be 0 if MSAA is not supported
+ int maxStencilSampleCount() const { return fMaxStencilSampleCount; }
+ // We require the sample count to be less than maxColorSampleCount and maxStencilSampleCount.
+ // If we are using mixed samples, we only care about stencil.
+ int maxSampleCount() const {
+ if (this->usesMixedSamples()) {
+ return this->maxStencilSampleCount();
+ } else {
+ return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCount());
+ }
+ }
+
virtual bool isConfigTexturable(GrPixelConfig config) const = 0;
virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const = 0;
@@ -235,7 +247,7 @@ protected:
bool fCompressedTexSubImageSupport : 1;
bool fOversizedStencilSupport : 1;
bool fTextureBarrierSupport : 1;
- bool fMixedSamplesSupport : 1;
+ bool fUsesMixedSamples : 1;
bool fSupportsInstancedDraws : 1;
bool fFullClearIsFree : 1;
bool fMustClearUploadedBufferData : 1;
@@ -257,7 +269,8 @@ protected:
int fMaxRenderTargetSize;
int fMaxTextureSize;
int fMaxTileSize;
- int fMaxSampleCount;
+ int fMaxColorSampleCount;
+ int fMaxStencilSampleCount;
private:
virtual void onApplyOptionsOverrides(const GrContextOptions&) {};
« no previous file with comments | « no previous file | src/gpu/GrCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698