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

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

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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
« no previous file with comments | « src/gpu/gl/GrGLPathRendering.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.h » ('j') | 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 2015 Google Inc. 2 * Copyright 2015 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 "gl/GrGLVaryingHandler.h" 8 #include "gl/GrGLVaryingHandler.h"
9 9
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
11 #include "gl/builders/GrGLProgramBuilder.h" 11 #include "gl/builders/GrGLProgramBuilder.h"
12 12
13 13
14 GrGLSLVaryingHandler::VaryingHandle GrGLVaryingHandler::addPathProcessingVarying ( 14 GrGLSLVaryingHandler::VaryingHandle GrGLVaryingHandler::addPathProcessingVarying (
15 const cha r* name, 15 const cha r* name,
16 GrGLSLVer tToFrag* v, 16 GrGLSLVer tToFrag* v,
17 GrSLPreci sion fsPrecision) { 17 GrSLPreci sion fsPrecision) {
18 #ifdef SK_DEBUG 18 #ifdef SK_DEBUG
19 GrGLProgramBuilder* glPB = (GrGLProgramBuilder*) fProgramBuilder; 19 GrGLProgramBuilder* glPB = (GrGLProgramBuilder*) fProgramBuilder;
20 // This call is not used for non-NVPR backends. 20 // This call is not used for non-NVPR backends.
21 SkASSERT(glPB->gpu()->glCaps().shaderCaps()->pathRenderingSupport() && 21 SkASSERT(glPB->gpu()->glCaps().shaderCaps()->pathRenderingSupport() &&
22 glPB->fArgs.fPrimitiveProcessor->isPathRendering() && 22 glPB->fPrimProc.isPathRendering() &&
23 !glPB->fArgs.fPrimitiveProcessor->willUseGeoShader() && 23 !glPB->fPrimProc.willUseGeoShader() &&
24 glPB->fArgs.fPrimitiveProcessor->numAttribs() == 0); 24 glPB->fPrimProc.numAttribs() == 0);
25 #endif 25 #endif
26 this->addVarying(name, v, fsPrecision); 26 this->addVarying(name, v, fsPrecision);
27 auto varyingInfo = fPathProcVaryingInfos.push_back(); 27 auto varyingInfo = fPathProcVaryingInfos.push_back();
28 varyingInfo.fLocation = fPathProcVaryingInfos.count() - 1; 28 varyingInfo.fLocation = fPathProcVaryingInfos.count() - 1;
29 return VaryingHandle(varyingInfo.fLocation); 29 return VaryingHandle(varyingInfo.fLocation);
30 } 30 }
31 31
32 void GrGLVaryingHandler::onFinalize() { 32 void GrGLVaryingHandler::onFinalize() {
33 SkASSERT(fPathProcVaryingInfos.empty() || fPathProcVaryingInfos.count() == f FragInputs.count()); 33 SkASSERT(fPathProcVaryingInfos.empty() || fPathProcVaryingInfos.count() == f FragInputs.count());
34 for (int i = 0; i < fPathProcVaryingInfos.count(); ++i) { 34 for (int i = 0; i < fPathProcVaryingInfos.count(); ++i) {
35 fPathProcVaryingInfos[i].fVariable = fFragInputs[i]; 35 fPathProcVaryingInfos[i].fVariable = fFragInputs[i];
36 } 36 }
37 } 37 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathRendering.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698