Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 367643004: Implement NVPR on GLES (Closed) Base URL: https://skia.googlesource.com/skia.git@02-path-program-fragment
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 fCurrentProgram.reset(fProgramCache->getProgram(desc, 251 fCurrentProgram.reset(fProgramCache->getProgram(desc,
252 colorStages.begin(), 252 colorStages.begin(),
253 coverageStages.begin())) ; 253 coverageStages.begin())) ;
254 if (NULL == fCurrentProgram.get()) { 254 if (NULL == fCurrentProgram.get()) {
255 SkDEBUGFAIL("Failed to create program!"); 255 SkDEBUGFAIL("Failed to create program!");
256 return false; 256 return false;
257 } 257 }
258 258
259 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type)
260 || !fCurrentProgram->hasVertexShader());
261
262 fCurrentProgram.get()->ref(); 259 fCurrentProgram.get()->ref();
263 260
264 GrGLuint programID = fCurrentProgram->programID(); 261 GrGLuint programID = fCurrentProgram->programID();
265 if (fHWProgramID != programID) { 262 if (fHWProgramID != programID) {
266 GL_CALL(UseProgram(programID)); 263 GL_CALL(UseProgram(programID));
267 fHWProgramID = programID; 264 fHWProgramID = programID;
268 } 265 }
269 266
270 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); 267 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff);
271 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); 268 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff);
272 269
273 fCurrentProgram->setData(blendOpts, 270 fCurrentProgram->setData(type,
271 blendOpts,
274 colorStages.begin(), 272 colorStages.begin(),
275 coverageStages.begin(), 273 coverageStages.begin(),
276 dstCopy, 274 dstCopy,
277 &fSharedGLProgramState); 275 &fSharedGLProgramState);
278 } 276 }
279 this->flushStencil(type); 277 this->flushStencil(type);
280 this->flushScissor(); 278 this->flushScissor();
281 this->flushAAState(type); 279 this->flushAAState(type);
282 280
283 SkIRect* devRect = NULL; 281 SkIRect* devRect = NULL;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 GrGLAttribTypeToLayout(attribType).fType, 366 GrGLAttribTypeToLayout(attribType).fType,
369 GrGLAttribTypeToLayout(attribType).fNormalized, 367 GrGLAttribTypeToLayout(attribType).fNormalized,
370 stride, 368 stride,
371 reinterpret_cast<GrGLvoid*>( 369 reinterpret_cast<GrGLvoid*>(
372 vertexOffsetInBytes + vertexAttrib->fOffset)); 370 vertexOffsetInBytes + vertexAttrib->fOffset));
373 } 371 }
374 } 372 }
375 attribState->disableUnusedArrays(this, usedAttribArraysMask); 373 attribState->disableUnusedArrays(this, usedAttribArraysMask);
376 } 374 }
377 } 375 }
OLDNEW
« src/gpu/gl/GrGpuGL.cpp ('K') | « src/gpu/gl/GrGpuGL.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698