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 #include "GrGpuGL.h" | 8 #include "GrGpuGL.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 ++fCurrLRUStamp; | 198 ++fCurrLRUStamp; |
199 return entry->fProgram; | 199 return entry->fProgram; |
200 } | 200 } |
201 | 201 |
202 //////////////////////////////////////////////////////////////////////////////// | 202 //////////////////////////////////////////////////////////////////////////////// |
203 | 203 |
204 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 204 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
205 | 205 |
206 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { | 206 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { |
207 const GrDrawState& drawState = this->getDrawState(); | 207 const GrDrawState& drawState = this->getDrawState(); |
208 const GrOptDrawState& optState = *this->getDrawState().createOptState(); | |
209 optState.unref(); | |
210 const GrOptDrawState& optState2 = *this->getDrawState().createOptState(); | |
211 optState2.unref(); | |
212 | 208 |
213 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 209 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
214 SkASSERT(drawState.getRenderTarget()); | 210 SkASSERT(drawState.getRenderTarget()); |
215 | 211 |
216 if (kStencilPath_DrawType == type) { | 212 if (kStencilPath_DrawType == type) { |
217 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); | 213 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); |
218 SkISize size; | 214 SkISize size; |
219 size.set(rt->width(), rt->height()); | 215 size.set(rt->width(), rt->height()); |
220 this->glPathRendering()->setProjectionMatrix(drawState.getViewMatrix(),
size, rt->origin()); | 216 this->glPathRendering()->setProjectionMatrix(drawState.getViewMatrix(),
size, rt->origin()); |
221 } else { | 217 } else { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 GrGLAttribTypeToLayout(attribType).fType, | 365 GrGLAttribTypeToLayout(attribType).fType, |
370 GrGLAttribTypeToLayout(attribType).fNormalized, | 366 GrGLAttribTypeToLayout(attribType).fNormalized, |
371 stride, | 367 stride, |
372 reinterpret_cast<GrGLvoid*>( | 368 reinterpret_cast<GrGLvoid*>( |
373 vertexOffsetInBytes + vertexAttrib->fOffset)); | 369 vertexOffsetInBytes + vertexAttrib->fOffset)); |
374 } | 370 } |
375 } | 371 } |
376 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 372 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
377 } | 373 } |
378 } | 374 } |
OLD | NEW |