| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); | 258 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); |
| 259 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); | 259 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); |
| 260 | 260 |
| 261 fCurrentProgram->setData(type, | 261 fCurrentProgram->setData(type, |
| 262 blendOpts, | 262 blendOpts, |
| 263 colorStages.begin(), | 263 colorStages.begin(), |
| 264 coverageStages.begin(), | 264 coverageStages.begin(), |
| 265 dstCopy, | 265 dstCopy, |
| 266 &fSharedGLProgramState); | 266 &fSharedGLProgramState); |
| 267 } | 267 } |
| 268 |
| 269 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(drawState.getRenderT
arget()); |
| 268 this->flushStencil(type); | 270 this->flushStencil(type); |
| 269 this->flushScissor(); | 271 this->flushScissor(glRT->getViewport(), glRT->origin()); |
| 270 this->flushAAState(type); | 272 this->flushAAState(type); |
| 271 | 273 |
| 272 SkIRect* devRect = NULL; | 274 SkIRect* devRect = NULL; |
| 273 SkIRect devClipBounds; | 275 SkIRect devClipBounds; |
| 274 if (drawState.isClipState()) { | 276 if (drawState.isClipState()) { |
| 275 this->getClip()->getConservativeBounds(drawState.getRenderTarget(), &dev
ClipBounds); | 277 this->getClip()->getConservativeBounds(drawState.getRenderTarget(), &dev
ClipBounds); |
| 276 devRect = &devClipBounds; | 278 devRect = &devClipBounds; |
| 277 } | 279 } |
| 278 // This must come after textures are flushed because a texture may need | 280 // This must come after textures are flushed because a texture may need |
| 279 // to be msaa-resolved (which will modify bound FBO state). | 281 // to be msaa-resolved (which will modify bound FBO state). |
| 280 this->flushRenderTarget(devRect); | 282 this->flushRenderTarget(glRT, devRect); |
| 281 | 283 |
| 282 return true; | 284 return true; |
| 283 } | 285 } |
| 284 | 286 |
| 285 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { | 287 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { |
| 286 | 288 |
| 287 GrGLsizei stride = static_cast<GrGLsizei>(this->getDrawState().getVertexStri
de()); | 289 GrGLsizei stride = static_cast<GrGLsizei>(this->getDrawState().getVertexStri
de()); |
| 288 | 290 |
| 289 size_t vertexOffsetInBytes = stride * info.startVertex(); | 291 size_t vertexOffsetInBytes = stride * info.startVertex(); |
| 290 | 292 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 GrGLAttribTypeToLayout(attribType).fType, | 359 GrGLAttribTypeToLayout(attribType).fType, |
| 358 GrGLAttribTypeToLayout(attribType).fNormalized, | 360 GrGLAttribTypeToLayout(attribType).fNormalized, |
| 359 stride, | 361 stride, |
| 360 reinterpret_cast<GrGLvoid*>( | 362 reinterpret_cast<GrGLvoid*>( |
| 361 vertexOffsetInBytes + vertexAttrib->fOffset)); | 363 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 362 } | 364 } |
| 363 } | 365 } |
| 364 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 366 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
| 365 } | 367 } |
| 366 } | 368 } |
| OLD | NEW |