OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef GrDrawTargetCaps_DEFINED | 8 #ifndef GrDrawTargetCaps_DEFINED |
9 #define GrDrawTargetCaps_DEFINED | 9 #define GrDrawTargetCaps_DEFINED |
10 | 10 |
(...skipping 54 matching lines...) Loading... |
65 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } | 65 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
66 int maxTextureSize() const { return fMaxTextureSize; } | 66 int maxTextureSize() const { return fMaxTextureSize; } |
67 // Will be 0 if MSAA is not supported | 67 // Will be 0 if MSAA is not supported |
68 int maxSampleCount() const { return fMaxSampleCount; } | 68 int maxSampleCount() const { return fMaxSampleCount; } |
69 | 69 |
70 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { | 70 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
71 SkASSERT(kGrPixelConfigCnt > config); | 71 SkASSERT(kGrPixelConfigCnt > config); |
72 return fConfigRenderSupport[config][withMSAA]; | 72 return fConfigRenderSupport[config][withMSAA]; |
73 } | 73 } |
74 | 74 |
75 bool compressedTextureSupport(GrCompressedFormat format) const { | |
76 SkASSERT(kGrCompressedFormatCount > format); | |
77 return fCompressedFormatSupport[format]; | |
78 } | |
79 | |
80 protected: | 75 protected: |
81 bool f8BitPaletteSupport : 1; | 76 bool f8BitPaletteSupport : 1; |
82 bool fNPOTTextureTileSupport : 1; | 77 bool fNPOTTextureTileSupport : 1; |
83 bool fMipMapSupport : 1; | 78 bool fMipMapSupport : 1; |
84 bool fTwoSidedStencilSupport : 1; | 79 bool fTwoSidedStencilSupport : 1; |
85 bool fStencilWrapOpsSupport : 1; | 80 bool fStencilWrapOpsSupport : 1; |
86 bool fHWAALineSupport : 1; | 81 bool fHWAALineSupport : 1; |
87 bool fShaderDerivativeSupport : 1; | 82 bool fShaderDerivativeSupport : 1; |
88 bool fGeometryShaderSupport : 1; | 83 bool fGeometryShaderSupport : 1; |
89 bool fDualSourceBlendingSupport : 1; | 84 bool fDualSourceBlendingSupport : 1; |
90 bool fPathRenderingSupport : 1; | 85 bool fPathRenderingSupport : 1; |
91 bool fDstReadInShaderSupport : 1; | 86 bool fDstReadInShaderSupport : 1; |
92 bool fDiscardRenderTargetSupport: 1; | 87 bool fDiscardRenderTargetSupport: 1; |
93 bool fReuseScratchTextures : 1; | 88 bool fReuseScratchTextures : 1; |
94 bool fGpuTracingSupport : 1; | 89 bool fGpuTracingSupport : 1; |
95 | 90 |
96 uint32_t fMapBufferFlags; | 91 uint32_t fMapBufferFlags; |
97 | 92 |
98 int fMaxRenderTargetSize; | 93 int fMaxRenderTargetSize; |
99 int fMaxTextureSize; | 94 int fMaxTextureSize; |
100 int fMaxSampleCount; | 95 int fMaxSampleCount; |
101 | 96 |
102 // The first entry for each config is without msaa and the second is with. | 97 // The first entry for each config is without msaa and the second is with. |
103 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 98 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
104 | 99 |
105 bool fCompressedFormatSupport[kGrCompressedFormatCount]; | |
106 | |
107 typedef SkRefCnt INHERITED; | 100 typedef SkRefCnt INHERITED; |
108 }; | 101 }; |
109 | 102 |
110 #endif | 103 #endif |
OLD | NEW |