OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #ifndef GrGLProgramDesc_DEFINED | 8 #ifndef GrGLProgramDesc_DEFINED |
9 #define GrGLProgramDesc_DEFINED | 9 #define GrGLProgramDesc_DEFINED |
10 | 10 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "GrProgramDesc.h" | 12 #include "GrProgramDesc.h" |
13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
14 #include "GrTypesPriv.h" | 14 #include "GrTypesPriv.h" |
15 | 15 |
16 class GrGpuGL; | 16 class GrGLGpu; |
17 | 17 |
18 /** | 18 /** |
19 * This class can be used to build a GrProgramDesc. It also provides helpers fo
r accessing | 19 * This class can be used to build a GrProgramDesc. It also provides helpers fo
r accessing |
20 * GL specific info in the header. | 20 * GL specific info in the header. |
21 */ | 21 */ |
22 class GrGLProgramDescBuilder { | 22 class GrGLProgramDescBuilder { |
23 public: | 23 public: |
24 struct GLKeyHeader : public GrProgramDesc::KeyHeader { | 24 struct GLKeyHeader : public GrProgramDesc::KeyHeader { |
25 SkBool8 fUseNvpr; | 25 SkBool8 fUseNvpr; |
26 }; | 26 }; |
(...skipping 18 matching lines...) Expand all Loading... |
45 * Builds a GL specific program descriptor | 45 * Builds a GL specific program descriptor |
46 * | 46 * |
47 * @param GrOptDrawState The optimized drawstate. The descriptor will repr
esent a program | 47 * @param GrOptDrawState The optimized drawstate. The descriptor will repr
esent a program |
48 * which this optstate can use to draw with. The opt
state contains | 48 * which this optstate can use to draw with. The opt
state contains |
49 * general draw information, as well as the specific
color, geometry, | 49 * general draw information, as well as the specific
color, geometry, |
50 * and coverage stages which will be used to generate
the GL Program for | 50 * and coverage stages which will be used to generate
the GL Program for |
51 * this optstate. | 51 * this optstate. |
52 * @param DescInfo A descriptor info struct, generated by the optstate, whi
ch contains a number | 52 * @param DescInfo A descriptor info struct, generated by the optstate, whi
ch contains a number |
53 * of important facts about the program the built descripto
r will represent | 53 * of important facts about the program the built descripto
r will represent |
54 * @param DrawType | 54 * @param DrawType |
55 * @param GrGpuGL A GL Gpu, the caps and Gpu object are used to output proc
essor specific | 55 * @param GrGLGpu A GL Gpu, the caps and Gpu object are used to output proc
essor specific |
56 * parts of the descriptor. | 56 * parts of the descriptor. |
57 * @param GrDeviceCoordTexture A dstCopy texture, which may be null if fram
e buffer fetch is | 57 * @param GrDeviceCoordTexture A dstCopy texture, which may be null if fram
e buffer fetch is |
58 * supported | 58 * supported |
59 * @param GrProgramDesc The built and finalized descriptor | 59 * @param GrProgramDesc The built and finalized descriptor |
60 **/ | 60 **/ |
61 static bool Build(const GrOptDrawState&, | 61 static bool Build(const GrOptDrawState&, |
62 const GrProgramDesc::DescInfo&, | 62 const GrProgramDesc::DescInfo&, |
63 GrGpu::DrawType, | 63 GrGpu::DrawType, |
64 GrGpuGL*, | 64 GrGLGpu*, |
65 GrProgramDesc*); | 65 GrProgramDesc*); |
66 | 66 |
67 static const GLKeyHeader& GetHeader(const GrProgramDesc& desc) { | 67 static const GLKeyHeader& GetHeader(const GrProgramDesc& desc) { |
68 return *desc.atOffset<GLKeyHeader, kHeaderOffset>(); | 68 return *desc.atOffset<GLKeyHeader, kHeaderOffset>(); |
69 } | 69 } |
70 }; | 70 }; |
71 | 71 |
72 #endif | 72 #endif |
OLD | NEW |