diff options
author | sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-03 13:52:32 +0000 |
---|---|---|
committer | sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-03 13:52:32 +0000 |
commit | 6ba0b0f9ad566e57e641c57e1f0f4876f2197010 (patch) | |
tree | b81666ea5d8fe58a06ba1a54c2eabcea6ced56e2 /src/gpu/gl/GrGpuGL.cpp | |
parent | 6b0cf0273fdffbbdf69235b57b5b5a311e7f1ca6 (diff) |
This may potentially fix a chromium issue and shouldn't hurt, so if anyone agrees that this fix should be harmless, we can try merging it in to see if it's enough to fix "Invalid pointer write in GrRenderTarget::onRelease".
R=bsalomon@google.com, robertphillips@google.com
Review URL: https://codereview.chromium.org/14607003
git-svn-id: http://skia.googlecode.com/svn/trunk@8982 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL.cpp')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 7cf70218e0..fb27e47c56 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -931,6 +931,11 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, if (glTexDesc.fWidth > maxRTSize || glTexDesc.fHeight > maxRTSize) { return return_null_texture(); } + } else { + int maxSize = this->caps()->maxTextureSize(); + if (glTexDesc.fWidth > maxSize || glTexDesc.fHeight > maxSize) { + return return_null_texture(); + } } GL_CALL(GenTextures(1, &glTexDesc.fTextureID)); @@ -1004,8 +1009,8 @@ namespace { const GrGLuint kUnknownBitCount = GrGLStencilBuffer::kUnknownBitCount; void inline get_stencil_rb_sizes(const GrGLInterface* gl, - GrGLuint rb, GrGLStencilBuffer::Format* format) { + // we shouldn't ever know one size and not the other GrAssert((kUnknownBitCount == format->fStencilBits) == (kUnknownBitCount == format->fTotalBits)); @@ -1071,7 +1076,7 @@ bool GrGpuGL::createStencilBufferForRenderTarget(GrRenderTarget* rt, // After sized formats we attempt an unsized format and take // whatever sizes GL gives us. In that case we query for the size. GrGLStencilBuffer::Format format = sFmt; - get_stencil_rb_sizes(this->glInterface(), sbID, &format); + get_stencil_rb_sizes(this->glInterface(), &format); static const bool kIsWrapped = false; SkAutoTUnref<GrStencilBuffer> sb(SkNEW_ARGS(GrGLStencilBuffer, (this, kIsWrapped, sbID, width, height, |