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 "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 fProgramCache = SkNEW_ARGS(ProgramCache, (this)); | 143 fProgramCache = SkNEW_ARGS(ProgramCache, (this)); |
144 | 144 |
145 SkASSERT(this->glCaps().maxVertexAttributes() >= GrDrawState::kMaxVertexAttr
ibCnt); | 145 SkASSERT(this->glCaps().maxVertexAttributes() >= GrDrawState::kMaxVertexAttr
ibCnt); |
146 | 146 |
147 fLastSuccessfulStencilFmtIdx = 0; | 147 fLastSuccessfulStencilFmtIdx = 0; |
148 fHWProgramID = 0; | 148 fHWProgramID = 0; |
149 | 149 |
150 if (this->glCaps().pathRenderingSupport()) { | 150 if (this->glCaps().pathRenderingSupport()) { |
151 fPathRendering.reset(GrGLPathRendering::Create(this, glInterface())); | 151 fPathRendering.reset(new GrGLPathRendering(this, glInterface())); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 GrGpuGL::~GrGpuGL() { | 155 GrGpuGL::~GrGpuGL() { |
156 if (0 != fHWProgramID) { | 156 if (0 != fHWProgramID) { |
157 // detach the current program so there is no confusion on OpenGL's part | 157 // detach the current program so there is no confusion on OpenGL's part |
158 // that we want it to be deleted | 158 // that we want it to be deleted |
159 SkASSERT(fHWProgramID == fCurrentProgram->programID()); | 159 SkASSERT(fHWProgramID == fCurrentProgram->programID()); |
160 GL_CALL(UseProgram(0)); | 160 GL_CALL(UseProgram(0)); |
161 } | 161 } |
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 this->setVertexArrayID(gpu, 0); | 2629 this->setVertexArrayID(gpu, 0); |
2630 } | 2630 } |
2631 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2631 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2632 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2632 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2633 fDefaultVertexArrayAttribState.resize(attrCount); | 2633 fDefaultVertexArrayAttribState.resize(attrCount); |
2634 } | 2634 } |
2635 attribState = &fDefaultVertexArrayAttribState; | 2635 attribState = &fDefaultVertexArrayAttribState; |
2636 } | 2636 } |
2637 return attribState; | 2637 return attribState; |
2638 } | 2638 } |
OLD | NEW |