OLD | NEW |
| (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 #ifndef GrGLPathProgramDataManager_DEFINED | |
9 #define GrGLPathProgramDataManager_DEFINED | |
10 | |
11 #include "gl/GrGLProgramDataManager.h" | |
12 | |
13 class GrGLPathProgram; | |
14 class GrGLPathProgramBuilder; | |
15 | |
16 /** Manages the resources used by a shader program for NVPR rendering. | |
17 */ | |
18 class GrGLPathProgramDataManager : SkNoncopyable { | |
19 public: | |
20 typedef GrGLProgramDataManager::ShaderResourceHandle SeparableVaryingHandle; | |
21 | |
22 struct SeparableVaryingInfo { | |
23 GrGLShaderVar fVariable; | |
24 GrGLint fLocation; | |
25 }; | |
26 | |
27 // This uses an allocator rather than array so that the GrGLShaderVars don't
move in memory | |
28 // after they are inserted. Users of GrGLShaderBuilder get refs to the vars
and ptrs to their | |
29 // name strings. Otherwise, we'd have to hand out copies. | |
30 typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray; | |
31 | |
32 GrGLPathProgramDataManager(GrGLGpu*, GrGLuint programID, const SeparableVary
ingInfoArray&); | |
33 | |
34 /** Functions for uploading the varying values. | |
35 */ | |
36 void setPathFragmentInputTransform(SeparableVaryingHandle u, | |
37 int components, | |
38 const SkMatrix& matrix) const; | |
39 private: | |
40 enum { | |
41 kUnusedSeparableVarying = -1, | |
42 }; | |
43 struct SeparableVarying { | |
44 GrGLint fLocation; | |
45 SkDEBUGCODE( | |
46 GrSLType fType; | |
47 int fArrayCount; | |
48 ); | |
49 }; | |
50 SkTArray<SeparableVarying, true> fSeparableVaryings; | |
51 GrGLGpu* fGpu; | |
52 GrGLuint fProgramID; | |
53 typedef SkNoncopyable INHERITED; | |
54 }; | |
55 #endif | |
OLD | NEW |