| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "gl/SkGLContextHelper.h" | 8 #include "gl/SkGLContextHelper.h" |
| 9 #include "GrGLUtil.h" | 9 #include "GrGLUtil.h" |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 GR_GL_RENDERBUFFER, | 75 GR_GL_RENDERBUFFER, |
| 76 fColorBufferID)); | 76 fColorBufferID)); |
| 77 SK_GL(*this, GenRenderbuffers(1, &fDepthStencilBufferID)); | 77 SK_GL(*this, GenRenderbuffers(1, &fDepthStencilBufferID)); |
| 78 SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fDepthStencilBufferID)
); | 78 SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fDepthStencilBufferID)
); |
| 79 | 79 |
| 80 // Some drivers that support packed depth stencil will only succeed | 80 // Some drivers that support packed depth stencil will only succeed |
| 81 // in binding a packed format an FBO. However, we can't rely on packed | 81 // in binding a packed format an FBO. However, we can't rely on packed |
| 82 // depth stencil being available. | 82 // depth stencil being available. |
| 83 bool supportsPackedDepthStencil; | 83 bool supportsPackedDepthStencil; |
| 84 if (kES_GrGLBinding == bindingInUse) { | 84 if (kES_GrGLBinding == bindingInUse) { |
| 85 supportsPackedDepthStencil = this->hasExtension("GL_OES_packed_depth
_stencil"); | 85 supportsPackedDepthStencil = version >= GR_GL_VER(3,0) || |
| 86 this->hasExtension("GL_OES_packed_depth
_stencil"); |
| 86 } else { | 87 } else { |
| 87 supportsPackedDepthStencil = version >= GR_GL_VER(3,0) || | 88 supportsPackedDepthStencil = version >= GR_GL_VER(3,0) || |
| 88 this->hasExtension("GL_EXT_packed_depth
_stencil") || | 89 this->hasExtension("GL_EXT_packed_depth
_stencil") || |
| 89 this->hasExtension("GL_ARB_framebuffer_
object"); | 90 this->hasExtension("GL_ARB_framebuffer_
object"); |
| 90 } | 91 } |
| 91 | 92 |
| 92 if (supportsPackedDepthStencil) { | 93 if (supportsPackedDepthStencil) { |
| 93 // ES2 requires sized internal formats for RenderbufferStorage | 94 // ES2 requires sized internal formats for RenderbufferStorage |
| 94 // On Desktop we let the driver decide. | 95 // On Desktop we let the driver decide. |
| 95 GrGLenum format = kES_GrGLBinding == bindingInUse ? | 96 GrGLenum format = kES_GrGLBinding == bindingInUse ? |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 fGL->unref(); | 131 fGL->unref(); |
| 131 fGL = NULL; | 132 fGL = NULL; |
| 132 this->destroyGLContext(); | 133 this->destroyGLContext(); |
| 133 return false; | 134 return false; |
| 134 } else { | 135 } else { |
| 135 return true; | 136 return true; |
| 136 } | 137 } |
| 137 } | 138 } |
| 138 return false; | 139 return false; |
| 139 } | 140 } |
| OLD | NEW |