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

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: rebse 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 241
242 fCurrentProgram.reset(fProgramCache->getProgram(desc, 242 fCurrentProgram.reset(fProgramCache->getProgram(desc,
243 colorStages.begin(), 243 colorStages.begin(),
244 coverageStages.begin())) ; 244 coverageStages.begin())) ;
245 if (NULL == fCurrentProgram.get()) { 245 if (NULL == fCurrentProgram.get()) {
246 SkDEBUGFAIL("Failed to create program!"); 246 SkDEBUGFAIL("Failed to create program!");
247 return false; 247 return false;
248 } 248 }
249 249
250 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type)
251 || !fCurrentProgram->hasVertexShader());
252
253 fCurrentProgram.get()->ref(); 250 fCurrentProgram.get()->ref();
254 251
255 GrGLuint programID = fCurrentProgram->programID(); 252 GrGLuint programID = fCurrentProgram->programID();
256 if (fHWProgramID != programID) { 253 if (fHWProgramID != programID) {
257 GL_CALL(UseProgram(programID)); 254 GL_CALL(UseProgram(programID));
258 fHWProgramID = programID; 255 fHWProgramID = programID;
259 } 256 }
260 257
261 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); 258 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff);
262 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); 259 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff);
263 260
264 fCurrentProgram->setData(blendOpts, 261 fCurrentProgram->setData(type,
262 blendOpts,
265 colorStages.begin(), 263 colorStages.begin(),
266 coverageStages.begin(), 264 coverageStages.begin(),
267 dstCopy, 265 dstCopy,
268 &fSharedGLProgramState); 266 &fSharedGLProgramState);
269 } 267 }
270 this->flushStencil(type); 268 this->flushStencil(type);
271 this->flushScissor(); 269 this->flushScissor();
272 this->flushAAState(type); 270 this->flushAAState(type);
273 271
274 SkIRect* devRect = NULL; 272 SkIRect* devRect = NULL;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 GrGLAttribTypeToLayout(attribType).fType, 357 GrGLAttribTypeToLayout(attribType).fType,
360 GrGLAttribTypeToLayout(attribType).fNormalized, 358 GrGLAttribTypeToLayout(attribType).fNormalized,
361 stride, 359 stride,
362 reinterpret_cast<GrGLvoid*>( 360 reinterpret_cast<GrGLvoid*>(
363 vertexOffsetInBytes + vertexAttrib->fOffset)); 361 vertexOffsetInBytes + vertexAttrib->fOffset));
364 } 362 }
365 } 363 }
366 attribState->disableUnusedArrays(this, usedAttribArraysMask); 364 attribState->disableUnusedArrays(this, usedAttribArraysMask);
367 } 365 }
368 } 366 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698