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

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

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 6 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/GrGLPathProgramDataManager.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "gl/GrGLPathProgramDataManager.h"
9 #include "gl/GrGLPathRendering.h"
10 #include "gl/GrGLUniformHandle.h"
11 #include "gl/GrGLGpu.h"
12 #include "SkMatrix.h"
13
14 GrGLPathProgramDataManager::GrGLPathProgramDataManager(
15 GrGLGpu* gpu, GrGLuint programID, const SeparableVaryingInfoArray& separable Varyings)
16 : fGpu(gpu)
17 , fProgramID(programID) {
18 int count = separableVaryings.count();
19 fSeparableVaryings.push_back_n(count);
20 for (int i = 0; i < count; i++) {
21 SeparableVarying& separableVarying = fSeparableVaryings[i];
22 const SeparableVaryingInfo& builderSeparableVarying = separableVaryings[ i];
23 SkASSERT(GrGLShaderVar::kNonArray == builderSeparableVarying.fVariable.g etArrayCount() ||
24 builderSeparableVarying.fVariable.getArrayCount() > 0);
25 SkDEBUGCODE(
26 separableVarying.fArrayCount = builderSeparableVarying.fVariable.get ArrayCount();
27 separableVarying.fType = builderSeparableVarying.fVariable.getType() ;
28 );
29 separableVarying.fLocation = builderSeparableVarying.fLocation;
30 }
31 }
32
33 void GrGLPathProgramDataManager::setPathFragmentInputTransform(SeparableVaryingH andle u,
34 int components,
35 const SkMatrix& m atrix) const {
36 const SeparableVarying& fragmentInput =
37 fSeparableVaryings[u.toProgramDataIndex()];
38
39 SkASSERT((components == 2 && fragmentInput.fType == kVec2f_GrSLType) ||
40 (components == 3 && fragmentInput.fType == kVec3f_GrSLType));
41
42 fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgramID,
43 fragmentInput. fLocation,
44 GR_GL_OBJECT_L INEAR,
45 components,
46 matrix);
47 }
48
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathProgramDataManager.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698