diff options
author | 2015-03-17 16:03:19 -0400 | |
---|---|---|
committer | 2015-03-17 16:03:19 -0400 | |
commit | 9251d4e9c6191aa26680911ed938dafdaebf5f61 (patch) | |
tree | e9d05c253e531f1dad69d0f246f641ad85c374d1 /src/gpu/gl | |
parent | e2aab90979d8fa741b735d0df6870cd338d51dac (diff) |
Use sample count for temp renderbuffer when clearing stenci
TBR=robertphillips@google.com
Review URL: https://codereview.chromium.org/1016903002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 34ceb066e0..a2c8d7f3ea 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -808,7 +808,7 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx, SkFAIL("Shouldn't be here if we don't support multisampled renderbuffers."); break; } - return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));; + return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface())); } bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted, GrGLuint texID, @@ -1208,7 +1208,11 @@ bool GrGLGpu::createStencilBufferForRenderTarget(GrRenderTarget* rt, int width, GrGLuint tempRB; GL_CALL(GenRenderbuffers(1, &tempRB)); GL_CALL(BindRenderbuffer(GR_GL_RENDERBUFFER, tempRB)); - GL_CALL(RenderbufferStorage(GR_GL_RENDERBUFFER, GR_GL_RGBA8, width, height)); + if (samples > 0) { + renderbuffer_storage_msaa(fGLContext, samples, GR_GL_RGBA8, width, height); + } else { + GL_CALL(RenderbufferStorage(GR_GL_RENDERBUFFER, GR_GL_RGBA8, width, height)); + } GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, GR_GL_COLOR_ATTACHMENT0, GR_GL_RENDERBUFFER, tempRB)); |