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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 //////////////////////////////////////////////////////////////////////////////// | 201 //////////////////////////////////////////////////////////////////////////////// |
202 | 202 |
203 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 203 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
204 | 204 |
205 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { | 205 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { |
206 const GrDrawState& drawState = this->getDrawState(); | 206 const GrDrawState& drawState = this->getDrawState(); |
207 | 207 |
208 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 208 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
209 SkASSERT(NULL != drawState.getRenderTarget()); | 209 SkASSERT(NULL != drawState.getRenderTarget()); |
210 | 210 |
211 if (kStencilPath_DrawType == type) { | 211 if (kStencilPath_DrawType == type || kFillPath_DrawType == type) { |
212 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); | 212 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); |
213 SkISize size; | 213 SkISize size; |
214 size.set(rt->width(), rt->height()); | 214 size.set(rt->width(), rt->height()); |
215 this->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin())
; | 215 this->setProjectionMatrix(drawState.getViewMatrix(), size, rt->origin())
; |
216 } else { | 216 } |
| 217 |
| 218 if (kStencilPath_DrawType != type) { |
217 this->flushMiscFixedFunctionState(); | 219 this->flushMiscFixedFunctionState(); |
218 | 220 |
219 GrBlendCoeff srcCoeff; | 221 GrBlendCoeff srcCoeff; |
220 GrBlendCoeff dstCoeff; | 222 GrBlendCoeff dstCoeff; |
221 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr
cCoeff, &dstCoeff); | 223 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr
cCoeff, &dstCoeff); |
222 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) { | 224 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) { |
223 return false; | 225 return false; |
224 } | 226 } |
225 | 227 |
226 SkSTArray<8, const GrEffectStage*, true> colorStages; | 228 SkSTArray<8, const GrEffectStage*, true> colorStages; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 GrGLAttribTypeToLayout(attribType).fType, | 365 GrGLAttribTypeToLayout(attribType).fType, |
364 GrGLAttribTypeToLayout(attribType).fNormalized, | 366 GrGLAttribTypeToLayout(attribType).fNormalized, |
365 stride, | 367 stride, |
366 reinterpret_cast<GrGLvoid*>( | 368 reinterpret_cast<GrGLvoid*>( |
367 vertexOffsetInBytes + vertexAttrib->fOffset)); | 369 vertexOffsetInBytes + vertexAttrib->fOffset)); |
368 } | 370 } |
369 | 371 |
370 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); | 372 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); |
371 } | 373 } |
372 } | 374 } |
OLD | NEW |