aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-04-06 09:42:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-06 09:42:57 -0700
commit94e50100eb747b2dfd659bacc9cf4246f6f20278 (patch)
treeac76fef50057cacfd7c69527b7c0b74c7d625848 /src/gpu/gl
parent143244e27d95255807d8fa505ce0affef96d1fc8 (diff)
When wrapping external textures, clamp the MSAA sample count to max.
This is the same clamp we do in onCreateTexture() for Skia-native textures. Without this fix, setting to a count higher than the max in Chrome results in a black screen. BUG=skia: Review URL: https://codereview.chromium.org/1056253003
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 566c8c5b8b..aff40ccc85 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -401,7 +401,7 @@ GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc) {
surfDesc.fWidth = desc.fWidth;
surfDesc.fHeight = desc.fHeight;
surfDesc.fConfig = desc.fConfig;
- surfDesc.fSampleCnt = desc.fSampleCnt;
+ surfDesc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount());
bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag);
// FIXME: this should be calling resolve_origin(), but Chrome code is currently
// assuming the old behaviour, which is that backend textures are always
@@ -442,7 +442,7 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
desc.fFlags = kCheckAllocation_GrSurfaceFlag;
desc.fWidth = wrapDesc.fWidth;
desc.fHeight = wrapDesc.fHeight;
- desc.fSampleCnt = wrapDesc.fSampleCnt;
+ desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount());
desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true);
GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc));