OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 8 |
9 #ifndef GrGLCaps_DEFINED | 9 #ifndef GrGLCaps_DEFINED |
10 #define GrGLCaps_DEFINED | 10 #define GrGLCaps_DEFINED |
11 | 11 |
12 #include "GrDrawTargetCaps.h" | 12 #include "GrDrawTargetCaps.h" |
13 #include "GrGLStencilBuffer.h" | 13 #include "GrGLStencilAttachment.h" |
14 #include "SkChecksum.h" | 14 #include "SkChecksum.h" |
15 #include "SkTHash.h" | 15 #include "SkTHash.h" |
16 #include "SkTArray.h" | 16 #include "SkTArray.h" |
17 | 17 |
18 class GrGLContextInfo; | 18 class GrGLContextInfo; |
19 | 19 |
20 /** | 20 /** |
21 * Stores some capabilities of a GL context. Most are determined by the GL | 21 * Stores some capabilities of a GL context. Most are determined by the GL |
22 * version and the extensions string. It also tracks formats that have passed | 22 * version and the extensions string. It also tracks formats that have passed |
23 * the FBO completeness test. | 23 * the FBO completeness test. |
24 */ | 24 */ |
25 class GrGLCaps : public GrDrawTargetCaps { | 25 class GrGLCaps : public GrDrawTargetCaps { |
26 public: | 26 public: |
27 SK_DECLARE_INST_COUNT(GrGLCaps) | 27 SK_DECLARE_INST_COUNT(GrGLCaps) |
28 | 28 |
29 typedef GrGLStencilBuffer::Format StencilFormat; | 29 typedef GrGLStencilAttachment::Format StencilFormat; |
30 | 30 |
31 /** | 31 /** |
32 * The type of MSAA for FBOs supported. Different extensions have different | 32 * The type of MSAA for FBOs supported. Different extensions have different |
33 * semantics of how / when a resolve is performed. | 33 * semantics of how / when a resolve is performed. |
34 */ | 34 */ |
35 enum MSFBOType { | 35 enum MSFBOType { |
36 /** | 36 /** |
37 * no support for MSAA FBOs | 37 * no support for MSAA FBOs |
38 */ | 38 */ |
39 kNone_MSFBOType = 0, | 39 kNone_MSFBOType = 0, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 /** | 127 /** |
128 * Call to note that a color config / stencil format pair passed | 128 * Call to note that a color config / stencil format pair passed |
129 * FBO status check. We may skip calling glCheckFramebufferStatus for | 129 * FBO status check. We may skip calling glCheckFramebufferStatus for |
130 * this combination in the future using | 130 * this combination in the future using |
131 * isColorConfigAndStencilFormatVerified(). | 131 * isColorConfigAndStencilFormatVerified(). |
132 */ | 132 */ |
133 void markColorConfigAndStencilFormatAsVerified( | 133 void markColorConfigAndStencilFormatAsVerified( |
134 GrPixelConfig config, | 134 GrPixelConfig config, |
135 const GrGLStencilBuffer::Format& format); | 135 const GrGLStencilAttachment::Format& format); |
136 | 136 |
137 /** | 137 /** |
138 * Call to check whether color config / stencil format pair has already | 138 * Call to check whether color config / stencil format pair has already |
139 * passed FBO status check. | 139 * passed FBO status check. |
140 */ | 140 */ |
141 bool isColorConfigAndStencilFormatVerified( | 141 bool isColorConfigAndStencilFormatVerified( |
142 GrPixelConfig config, | 142 GrPixelConfig config, |
143 const GrGLStencilBuffer::Format& format) const; | 143 const GrGLStencilAttachment::Format& format) const; |
144 | 144 |
145 /** | 145 /** |
146 * Reports the type of MSAA FBO support. | 146 * Reports the type of MSAA FBO support. |
147 */ | 147 */ |
148 MSFBOType msFBOType() const { return fMSFBOType; } | 148 MSFBOType msFBOType() const { return fMSFBOType; } |
149 | 149 |
150 /** | 150 /** |
151 * Does the supported MSAA FBO extension have MSAA renderbuffers? | 151 * Does the supported MSAA FBO extension have MSAA renderbuffers? |
152 */ | 152 */ |
153 bool usesMSAARenderBuffers() const { | 153 bool usesMSAARenderBuffers() const { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 && fType == rhs.fType | 406 && fType == rhs.fType |
407 && fFboFormat == rhs.fFboFormat; | 407 && fFboFormat == rhs.fFboFormat; |
408 } | 408 } |
409 }; | 409 }; |
410 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach
e; | 410 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach
e; |
411 | 411 |
412 typedef GrDrawTargetCaps INHERITED; | 412 typedef GrDrawTargetCaps INHERITED; |
413 }; | 413 }; |
414 | 414 |
415 #endif | 415 #endif |
OLD | NEW |