OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 samples, | 1160 samples, |
1161 sFmt.fInternalFormat, | 1161 sFmt.fInternalFormat, |
1162 width, height); | 1162 width, height); |
1163 } else { | 1163 } else { |
1164 GL_ALLOC_CALL(this->glInterface(), RenderbufferStorage(GR_GL_RENDERB
UFFER, | 1164 GL_ALLOC_CALL(this->glInterface(), RenderbufferStorage(GR_GL_RENDERB
UFFER, |
1165 sFmt.fInterna
lFormat, | 1165 sFmt.fInterna
lFormat, |
1166 width, height
)); | 1166 width, height
)); |
1167 created = (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glI
nterface())); | 1167 created = (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glI
nterface())); |
1168 } | 1168 } |
1169 if (created) { | 1169 if (created) { |
1170 | 1170 fStats.incStencilBufferCreates(); |
1171 // After sized formats we attempt an unsized format and take | 1171 // After sized formats we attempt an unsized format and take |
1172 // whatever sizes GL gives us. In that case we query for the size. | 1172 // whatever sizes GL gives us. In that case we query for the size. |
1173 GrGLStencilBuffer::Format format = sFmt; | 1173 GrGLStencilBuffer::Format format = sFmt; |
1174 get_stencil_rb_sizes(this->glInterface(), &format); | 1174 get_stencil_rb_sizes(this->glInterface(), &format); |
1175 SkAutoTUnref<GrStencilBuffer> sb(SkNEW_ARGS(GrGLStencilBuffer, | 1175 SkAutoTUnref<GrStencilBuffer> sb(SkNEW_ARGS(GrGLStencilBuffer, |
1176 (this, sbDesc, width, height,
samples, format))); | 1176 (this, sbDesc, width, height,
samples, format))); |
1177 if (this->attachStencilBufferToRenderTarget(sb, rt)) { | 1177 if (this->attachStencilBufferToRenderTarget(sb, rt)) { |
1178 fLastSuccessfulStencilFmtIdx = sIdx; | 1178 fLastSuccessfulStencilFmtIdx = sIdx; |
1179 rt->renderTargetPriv().didAttachStencilBuffer(sb); | 1179 rt->renderTargetPriv().didAttachStencilBuffer(sb); |
1180 return true; | 1180 return true; |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2759 this->setVertexArrayID(gpu, 0); | 2759 this->setVertexArrayID(gpu, 0); |
2760 } | 2760 } |
2761 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2761 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2762 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2762 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2763 fDefaultVertexArrayAttribState.resize(attrCount); | 2763 fDefaultVertexArrayAttribState.resize(attrCount); |
2764 } | 2764 } |
2765 attribState = &fDefaultVertexArrayAttribState; | 2765 attribState = &fDefaultVertexArrayAttribState; |
2766 } | 2766 } |
2767 return attribState; | 2767 return attribState; |
2768 } | 2768 } |
OLD | NEW |