| 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 "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
| 10 #include "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
| (...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 GrXferProcessor::BlendInfo blendInfo; | 1412 GrXferProcessor::BlendInfo blendInfo; |
| 1413 const GrPipeline& pipeline = *args.fPipeline; | 1413 const GrPipeline& pipeline = *args.fPipeline; |
| 1414 args.fPipeline->getXferProcessor()->getBlendInfo(&blendInfo); | 1414 args.fPipeline->getXferProcessor()->getBlendInfo(&blendInfo); |
| 1415 | 1415 |
| 1416 this->flushDither(pipeline.isDitherState()); | 1416 this->flushDither(pipeline.isDitherState()); |
| 1417 this->flushColorWrite(blendInfo.fWriteColor); | 1417 this->flushColorWrite(blendInfo.fWriteColor); |
| 1418 this->flushDrawFace(pipeline.getDrawFace()); | 1418 this->flushDrawFace(pipeline.getDrawFace()); |
| 1419 | 1419 |
| 1420 fCurrentProgram.reset(fProgramCache->getProgram(args)); | 1420 fCurrentProgram.reset(fProgramCache->getProgram(args)); |
| 1421 if (NULL == fCurrentProgram.get()) { | 1421 if (NULL == fCurrentProgram.get()) { |
| 1422 SkDEBUGFAIL("Failed to create program!"); | 1422 GrContextDebugf(this->getContext(), "Failed to create program!\n"); |
| 1423 return false; | 1423 return false; |
| 1424 } | 1424 } |
| 1425 | 1425 |
| 1426 fCurrentProgram.get()->ref(); | 1426 fCurrentProgram.get()->ref(); |
| 1427 | 1427 |
| 1428 GrGLuint programID = fCurrentProgram->programID(); | 1428 GrGLuint programID = fCurrentProgram->programID(); |
| 1429 if (fHWProgramID != programID) { | 1429 if (fHWProgramID != programID) { |
| 1430 GL_CALL(UseProgram(programID)); | 1430 GL_CALL(UseProgram(programID)); |
| 1431 fHWProgramID = programID; | 1431 fHWProgramID = programID; |
| 1432 } | 1432 } |
| (...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2849 this->setVertexArrayID(gpu, 0); | 2849 this->setVertexArrayID(gpu, 0); |
| 2850 } | 2850 } |
| 2851 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2851 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2852 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2852 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2853 fDefaultVertexArrayAttribState.resize(attrCount); | 2853 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2854 } | 2854 } |
| 2855 attribState = &fDefaultVertexArrayAttribState; | 2855 attribState = &fDefaultVertexArrayAttribState; |
| 2856 } | 2856 } |
| 2857 return attribState; | 2857 return attribState; |
| 2858 } | 2858 } |
| OLD | NEW |