| 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 "builders/GrGLProgramBuilder.h" | 10 #include "builders/GrGLProgramBuilder.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 ++fCurrLRUStamp; | 196 ++fCurrLRUStamp; |
| 197 return entry->fProgram; | 197 return entry->fProgram; |
| 198 } | 198 } |
| 199 | 199 |
| 200 //////////////////////////////////////////////////////////////////////////////// | 200 //////////////////////////////////////////////////////////////////////////////// |
| 201 | 201 |
| 202 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 202 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
| 203 | 203 |
| 204 bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState, | 204 bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState, |
| 205 DrawType type, | 205 DrawType type, |
| 206 const GrClipMaskManager::ScissorState& scissorS
tate, | |
| 207 const GrDeviceCoordTexture* dstCopy) { | 206 const GrDeviceCoordTexture* dstCopy) { |
| 208 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 207 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
| 209 SkASSERT(optState.getRenderTarget()); | 208 SkASSERT(optState.getRenderTarget()); |
| 210 | 209 |
| 211 if (kStencilPath_DrawType == type) { | 210 if (kStencilPath_DrawType == type) { |
| 212 const GrRenderTarget* rt = optState.getRenderTarget(); | 211 const GrRenderTarget* rt = optState.getRenderTarget(); |
| 213 SkISize size; | 212 SkISize size; |
| 214 size.set(rt->width(), rt->height()); | 213 size.set(rt->width(), rt->height()); |
| 215 this->glPathRendering()->setProjectionMatrix(optState.getViewMatrix(), s
ize, rt->origin()); | 214 this->glPathRendering()->setProjectionMatrix(optState.getViewMatrix(), s
ize, rt->origin()); |
| 216 } else { | 215 } else { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 239 fHWProgramID = programID; | 238 fHWProgramID = programID; |
| 240 } | 239 } |
| 241 | 240 |
| 242 this->flushBlend(optState, kDrawLines_DrawType == type, srcCoeff, dstCoe
ff); | 241 this->flushBlend(optState, kDrawLines_DrawType == type, srcCoeff, dstCoe
ff); |
| 243 | 242 |
| 244 fCurrentProgram->setData(optState, type, dstCopy); | 243 fCurrentProgram->setData(optState, type, dstCopy); |
| 245 } | 244 } |
| 246 | 245 |
| 247 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState.getRenderTa
rget()); | 246 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState.getRenderTa
rget()); |
| 248 this->flushStencil(optState.getStencil(), type); | 247 this->flushStencil(optState.getStencil(), type); |
| 249 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin()); | 248 this->flushScissor(optState.getScissorState(), glRT->getViewport(), glRT->or
igin()); |
| 250 this->flushAAState(optState, type); | 249 this->flushAAState(optState, type); |
| 251 | 250 |
| 252 // This must come after textures are flushed because a texture may need | 251 // This must come after textures are flushed because a texture may need |
| 253 // to be msaa-resolved (which will modify bound FBO state). | 252 // to be msaa-resolved (which will modify bound FBO state). |
| 254 this->flushRenderTarget(glRT, NULL); | 253 this->flushRenderTarget(glRT, NULL); |
| 255 | 254 |
| 256 return true; | 255 return true; |
| 257 } | 256 } |
| 258 | 257 |
| 259 void GrGpuGL::setupGeometry(const GrOptDrawState& optState, | 258 void GrGpuGL::setupGeometry(const GrOptDrawState& optState, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 308 |
| 310 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, | 309 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, |
| 311 const GrProgramDesc::DescInfo& descInfo, | 310 const GrProgramDesc::DescInfo& descInfo, |
| 312 GrGpu::DrawType drawType, | 311 GrGpu::DrawType drawType, |
| 313 const GrDeviceCoordTexture* dstCopy, | 312 const GrDeviceCoordTexture* dstCopy, |
| 314 GrProgramDesc* desc) { | 313 GrProgramDesc* desc) { |
| 315 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo
py, desc)) { | 314 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo
py, desc)) { |
| 316 SkDEBUGFAIL("Failed to generate GL program descriptor"); | 315 SkDEBUGFAIL("Failed to generate GL program descriptor"); |
| 317 } | 316 } |
| 318 } | 317 } |
| OLD | NEW |