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 | 11 |
11 #ifndef GrDrawTargetCaps_DEFINED | 12 #ifndef GrDrawTargetCaps_DEFINED |
12 #define GrDrawTargetCaps_DEFINED | 13 #define GrDrawTargetCaps_DEFINED |
13 | 14 |
14 /** | 15 /** |
15 * Represents the draw target capabilities. | 16 * Represents the draw target capabilities. |
16 */ | 17 */ |
17 class GrDrawTargetCaps : public SkRefCnt { | 18 class GrDrawTargetCaps : public SkRefCnt { |
18 public: | 19 public: |
19 SK_DECLARE_INST_COUNT(Caps) | 20 SK_DECLARE_INST_COUNT(Caps) |
(...skipping 16 matching lines...) Expand all Loading... |
36 bool bufferLockSupport() const { return fBufferLockSupport; } | 37 bool bufferLockSupport() const { return fBufferLockSupport; } |
37 bool pathRenderingSupport() const { return fPathRenderingSupport; } | 38 bool pathRenderingSupport() const { return fPathRenderingSupport; } |
38 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } | 39 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
39 bool reuseScratchTextures() const { return fReuseScratchTextures; } | 40 bool reuseScratchTextures() const { return fReuseScratchTextures; } |
40 | 41 |
41 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } | 42 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
42 int maxTextureSize() const { return fMaxTextureSize; } | 43 int maxTextureSize() const { return fMaxTextureSize; } |
43 // Will be 0 if MSAA is not supported | 44 // Will be 0 if MSAA is not supported |
44 int maxSampleCount() const { return fMaxSampleCount; } | 45 int maxSampleCount() const { return fMaxSampleCount; } |
45 | 46 |
| 47 /** |
| 48 * Can the provided configuration act as a render target? |
| 49 */ |
| 50 bool isConfigRenderable(GrPixelConfig config) const { |
| 51 SkASSERT(kGrPixelConfigCnt > config); |
| 52 return fConfigRenderSupport[config]; |
| 53 } |
| 54 |
46 protected: | 55 protected: |
47 bool f8BitPaletteSupport : 1; | 56 bool f8BitPaletteSupport : 1; |
48 bool fNPOTTextureTileSupport : 1; | 57 bool fNPOTTextureTileSupport : 1; |
49 bool fTwoSidedStencilSupport : 1; | 58 bool fTwoSidedStencilSupport : 1; |
50 bool fStencilWrapOpsSupport : 1; | 59 bool fStencilWrapOpsSupport : 1; |
51 bool fHWAALineSupport : 1; | 60 bool fHWAALineSupport : 1; |
52 bool fShaderDerivativeSupport : 1; | 61 bool fShaderDerivativeSupport : 1; |
53 bool fGeometryShaderSupport : 1; | 62 bool fGeometryShaderSupport : 1; |
54 bool fDualSourceBlendingSupport : 1; | 63 bool fDualSourceBlendingSupport : 1; |
55 bool fBufferLockSupport : 1; | 64 bool fBufferLockSupport : 1; |
56 bool fPathRenderingSupport : 1; | 65 bool fPathRenderingSupport : 1; |
57 bool fDstReadInShaderSupport : 1; | 66 bool fDstReadInShaderSupport : 1; |
58 bool fReuseScratchTextures : 1; | 67 bool fReuseScratchTextures : 1; |
59 | 68 |
60 int fMaxRenderTargetSize; | 69 int fMaxRenderTargetSize; |
61 int fMaxTextureSize; | 70 int fMaxTextureSize; |
62 int fMaxSampleCount; | 71 int fMaxSampleCount; |
63 | 72 |
| 73 bool fConfigRenderSupport[kGrPixelConfigCnt]; |
| 74 |
64 typedef SkRefCnt INHERITED; | 75 typedef SkRefCnt INHERITED; |
65 }; | 76 }; |
66 | 77 |
67 #endif | 78 #endif |
OLD | NEW |