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 | 8 |
9 #include "SkRefCnt.h" | 9 #include "SkRefCnt.h" |
10 #include "GrTypes.h" | 10 #include "GrTypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 bool bufferLockSupport() const { return fBufferLockSupport; } | 37 bool bufferLockSupport() const { return fBufferLockSupport; } |
38 bool pathRenderingSupport() const { return fPathRenderingSupport; } | 38 bool pathRenderingSupport() const { return fPathRenderingSupport; } |
39 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } | 39 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
40 bool reuseScratchTextures() const { return fReuseScratchTextures; } | 40 bool reuseScratchTextures() const { return fReuseScratchTextures; } |
41 | 41 |
42 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } | 42 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
43 int maxTextureSize() const { return fMaxTextureSize; } | 43 int maxTextureSize() const { return fMaxTextureSize; } |
44 // Will be 0 if MSAA is not supported | 44 // Will be 0 if MSAA is not supported |
45 int maxSampleCount() const { return fMaxSampleCount; } | 45 int maxSampleCount() const { return fMaxSampleCount; } |
46 | 46 |
47 /** | 47 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
48 * Can the provided configuration act as a render target? | |
49 */ | |
50 bool isConfigRenderable(GrPixelConfig config) const { | |
51 SkASSERT(kGrPixelConfigCnt > config); | 48 SkASSERT(kGrPixelConfigCnt > config); |
52 return fConfigRenderSupport[config]; | 49 return fConfigRenderSupport[config][withMSAA]; |
53 } | 50 } |
54 | 51 |
55 protected: | 52 protected: |
56 bool f8BitPaletteSupport : 1; | 53 bool f8BitPaletteSupport : 1; |
57 bool fNPOTTextureTileSupport : 1; | 54 bool fNPOTTextureTileSupport : 1; |
58 bool fTwoSidedStencilSupport : 1; | 55 bool fTwoSidedStencilSupport : 1; |
59 bool fStencilWrapOpsSupport : 1; | 56 bool fStencilWrapOpsSupport : 1; |
60 bool fHWAALineSupport : 1; | 57 bool fHWAALineSupport : 1; |
61 bool fShaderDerivativeSupport : 1; | 58 bool fShaderDerivativeSupport : 1; |
62 bool fGeometryShaderSupport : 1; | 59 bool fGeometryShaderSupport : 1; |
63 bool fDualSourceBlendingSupport : 1; | 60 bool fDualSourceBlendingSupport : 1; |
64 bool fBufferLockSupport : 1; | 61 bool fBufferLockSupport : 1; |
65 bool fPathRenderingSupport : 1; | 62 bool fPathRenderingSupport : 1; |
66 bool fDstReadInShaderSupport : 1; | 63 bool fDstReadInShaderSupport : 1; |
67 bool fReuseScratchTextures : 1; | 64 bool fReuseScratchTextures : 1; |
68 | 65 |
69 int fMaxRenderTargetSize; | 66 int fMaxRenderTargetSize; |
70 int fMaxTextureSize; | 67 int fMaxTextureSize; |
71 int fMaxSampleCount; | 68 int fMaxSampleCount; |
72 | 69 |
73 bool fConfigRenderSupport[kGrPixelConfigCnt]; | 70 // The first entry for each config is without msaa and the second is with. |
| 71 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
74 | 72 |
75 typedef SkRefCnt INHERITED; | 73 typedef SkRefCnt INHERITED; |
76 }; | 74 }; |
77 | 75 |
78 #endif | 76 #endif |
OLD | NEW |