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

Unified Diff: src/gpu/GrGpu.cpp

Issue 1592803002: Differentiate maxColorSamples and maxStencilSamples in GrCaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 2815f612d602707c2186d1348d8deca5ba45c426..b4572d55d80f9e255fc4c65271beb7e7e09c0800 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -124,7 +124,11 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted,
GrGpuResource::LifeCycle lifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle :
GrGpuResource::kUncached_LifeCycle;
- desc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount());
+ // We require the sample count to be less than both the max color sample count and
+ // max stencil sample count supported by the system
+ int maxSampleCount = SkTMin(this->caps()->maxColorSampleCount(),
+ this->caps()->maxStencilSampleCount());
+ desc.fSampleCnt = SkTMin(desc.fSampleCnt, maxSampleCount);
// Attempt to catch un- or wrongly initialized sample counts;
SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);

Powered by Google App Engine
This is Rietveld 408576698