aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-09-05 15:02:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-05 19:19:45 +0000
commit91f9a2c2bbd7cf52aad5d2f90e0608c04ffcfdf7 (patch)
tree67a69ee098a75f69f05876c47aba896c099736fe
parent1f1aa2dddb105b8fe309624ca001d86377183f11 (diff)
Unbind xfer buffer before trying to call TexImage2D
Bug: skia: Change-Id: Ie36cebc14c4f4e47f143ae79efbea7088637acf4 Reviewed-on: https://skia-review.googlesource.com/42523 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
-rw-r--r--src/gpu/gl/GrGLGpu.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index ec52f92cd7..af7156c759 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1480,6 +1480,14 @@ int GrGLGpu::getCompatibleStencilIndex(GrPixelConfig config) {
if (!this->glCaps().hasStencilFormatBeenDeterminedForConfig(config)) {
// Default to unsupported, set this if we find a stencil format that works.
int firstWorkingStencilFormatIndex = -1;
+
+ // unbind any previous transfer buffer
+ auto& xferBufferState = fHWBufferState[kXferCpuToGpu_GrBufferType];
+ if (!xferBufferState.fBoundBufferUniqueID.isInvalid()) {
+ GL_CALL(BindBuffer(xferBufferState.fGLTarget, 0));
+ xferBufferState.invalidate();
+ }
+
// Create color texture
GrGLuint colorID = 0;
GL_CALL(GenTextures(1, &colorID));