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

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

Issue 758973002: Remove unnessary check to skip drawing. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 const GrRenderTarget* rt = optState.getRenderTarget(); 209 const GrRenderTarget* rt = optState.getRenderTarget();
210 SkISize size; 210 SkISize size;
211 size.set(rt->width(), rt->height()); 211 size.set(rt->width(), rt->height());
212 this->glPathRendering()->setProjectionMatrix(optState.getViewMatrix(), s ize, rt->origin()); 212 this->glPathRendering()->setProjectionMatrix(optState.getViewMatrix(), s ize, rt->origin());
213 } else { 213 } else {
214 this->flushMiscFixedFunctionState(optState); 214 this->flushMiscFixedFunctionState(optState);
215 215
216 GrBlendCoeff srcCoeff = optState.getSrcBlendCoeff(); 216 GrBlendCoeff srcCoeff = optState.getSrcBlendCoeff();
217 GrBlendCoeff dstCoeff = optState.getDstBlendCoeff(); 217 GrBlendCoeff dstCoeff = optState.getDstBlendCoeff();
218 218
219 // In these blend coeff's we end up drawing nothing so we can skip draw all together
220 if (kZero_GrBlendCoeff == srcCoeff && kOne_GrBlendCoeff == dstCoeff &&
221 !optState.getStencil().doesWrite()) {
222 return false;
223 }
224
225 fCurrentProgram.reset(fProgramCache->getProgram(optState, type)); 219 fCurrentProgram.reset(fProgramCache->getProgram(optState, type));
226 if (NULL == fCurrentProgram.get()) { 220 if (NULL == fCurrentProgram.get()) {
227 SkDEBUGFAIL("Failed to create program!"); 221 SkDEBUGFAIL("Failed to create program!");
228 return false; 222 return false;
229 } 223 }
230 224
231 fCurrentProgram.get()->ref(); 225 fCurrentProgram.get()->ref();
232 226
233 GrGLuint programID = fCurrentProgram->programID(); 227 GrGLuint programID = fCurrentProgram->programID();
234 if (fHWProgramID != programID) { 228 if (fHWProgramID != programID) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 299 }
306 300
307 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, 301 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState,
308 const GrProgramDesc::DescInfo& descInfo, 302 const GrProgramDesc::DescInfo& descInfo,
309 GrGpu::DrawType drawType, 303 GrGpu::DrawType drawType,
310 GrProgramDesc* desc) { 304 GrProgramDesc* desc) {
311 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, desc) ) { 305 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, desc) ) {
312 SkDEBUGFAIL("Failed to generate GL program descriptor"); 306 SkDEBUGFAIL("Failed to generate GL program descriptor");
313 } 307 }
314 } 308 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698