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 GrGLGpu; | 16 class GrGLGpu; |
| 17 class GrGLProgramDescBuilder; |
| 18 |
| 19 class GrGLProgramDesc : public GrProgramDesc { |
| 20 friend class GrGLProgramDescBuilder; |
| 21 }; |
17 | 22 |
18 /** | 23 /** |
19 * This class can be used to build a GrProgramDesc. It also provides helpers fo
r accessing | 24 * This class can be used to build a GrProgramDesc. It also provides helpers fo
r accessing |
20 * GL specific info in the header. | 25 * GL specific info in the header. |
21 */ | 26 */ |
22 class GrGLProgramDescBuilder { | 27 class GrGLProgramDescBuilder { |
23 public: | 28 public: |
24 typedef GrProgramDesc::KeyHeader KeyHeader; | 29 typedef GrProgramDesc::KeyHeader KeyHeader; |
25 // The key, stored in fKey, is composed of five parts(first 2 are defined in
the key itself): | 30 // The key, stored in fKey, is composed of five parts(first 2 are defined in
the key itself): |
26 // 1. uint32_t for total key length. | 31 // 1. uint32_t for total key length. |
27 // 2. uint32_t for a checksum. | 32 // 2. uint32_t for a checksum. |
28 // 3. Header struct defined above. | 33 // 3. Header struct defined above. |
29 // 4. Backend-specific information including per-processor keys and their ke
y lengths. | 34 // 4. Backend-specific information including per-processor keys and their ke
y lengths. |
30 // Each processor's key is a variable length array of uint32_t. | 35 // Each processor's key is a variable length array of uint32_t. |
31 enum { | 36 enum { |
32 // Part 3. | 37 // Part 3. |
33 kHeaderOffset = GrProgramDesc::kHeaderOffset, | 38 kHeaderOffset = GrGLProgramDesc::kHeaderOffset, |
34 kHeaderSize = SkAlign4(sizeof(KeyHeader)), | 39 kHeaderSize = SkAlign4(sizeof(KeyHeader)), |
35 // Part 4. | 40 // Part 4. |
36 // This is the offset into the backenend specific part of the key, which
includes | 41 // This is the offset into the backenend specific part of the key, which
includes |
37 // per-processor keys. | 42 // per-processor keys. |
38 kProcessorKeysOffset = kHeaderOffset + kHeaderSize, | 43 kProcessorKeysOffset = kHeaderOffset + kHeaderSize, |
39 }; | 44 }; |
40 | 45 |
41 /** | 46 /** |
42 * Builds a GL specific program descriptor | 47 * Builds a GL specific program descriptor |
43 * | 48 * |
(...skipping 10 matching lines...) Expand all Loading... |
54 * @param GrProgramDesc The built and finalized descriptor | 59 * @param GrProgramDesc The built and finalized descriptor |
55 **/ | 60 **/ |
56 static bool Build(GrProgramDesc*, | 61 static bool Build(GrProgramDesc*, |
57 const GrPrimitiveProcessor&, | 62 const GrPrimitiveProcessor&, |
58 const GrPipeline&, | 63 const GrPipeline&, |
59 const GrGLGpu*, | 64 const GrGLGpu*, |
60 const GrBatchTracker&); | 65 const GrBatchTracker&); |
61 }; | 66 }; |
62 | 67 |
63 #endif | 68 #endif |
OLD | NEW |