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

Unified Diff: src/gpu/gl/GrGLGpu.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
« src/gpu/GrContext.cpp ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 248a5dfbd250e91f45daa974be4f8b8d929324bc..d3fe62f91519b3e4aa99719404a19d0e0bf3d610 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -483,7 +483,11 @@ GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
surfDesc.fWidth = desc.fWidth;
surfDesc.fHeight = desc.fHeight;
surfDesc.fConfig = desc.fConfig;
- surfDesc.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());
+ surfDesc.fSampleCnt = SkTMin(desc.fSampleCnt, maxSampleCount);
bsalomon 2016/01/15 18:08:29 Probably want to consider mixed samples here
// FIXME: this should be calling resolve_origin(), but Chrome code is currently
// assuming the old behaviour, which is that backend textures are always
// BottomLeft, even for non-RT's. Once Chrome is fixed, change this to:
@@ -533,7 +537,11 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag;
desc.fWidth = wrapDesc.fWidth;
desc.fHeight = wrapDesc.fHeight;
- desc.fSampleCnt = SkTMin(wrapDesc.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(wrapDesc.fSampleCnt, maxSampleCount);
bsalomon 2016/01/15 18:08:29 and here
desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true);
return GrGLRenderTarget::CreateWrapped(this, desc, idDesc, wrapDesc.fStencilBits);
« src/gpu/GrContext.cpp ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698