bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2013 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #include "SkRefCnt.h" |
| 10 | |
| 11 | #ifndef GrDrawTargetCaps_DEFINED |
| 12 | #define GrDrawTargetCaps_DEFINED |
| 13 | |
| 14 | /** |
| 15 | * Represents the draw target capabilities. |
| 16 | */ |
| 17 | class GrDrawTargetCaps : public SkRefCnt { |
| 18 | public: |
| 19 | SK_DECLARE_INST_COUNT(Caps) |
| 20 | |
| 21 | GrDrawTargetCaps() { this->reset(); } |
commit-bot@chromium.org | faa5ae4 | 2013-07-23 11:13:56 +0000 | [diff] [blame] | 22 | GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = other; } |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 23 | GrDrawTargetCaps& operator= (const GrDrawTargetCaps&); |
| 24 | |
| 25 | virtual void reset(); |
| 26 | virtual void print() const; |
| 27 | |
| 28 | bool eightBitPaletteSupport() const { return f8BitPaletteSupport; } |
| 29 | bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } |
| 30 | bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } |
| 31 | bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } |
| 32 | bool hwAALineSupport() const { return fHWAALineSupport; } |
| 33 | bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } |
| 34 | bool geometryShaderSupport() const { return fGeometryShaderSupport; } |
| 35 | bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; } |
| 36 | bool bufferLockSupport() const { return fBufferLockSupport; } |
commit-bot@chromium.org | c4dc0ad | 2013-10-09 14:11:33 +0000 | [diff] [blame^] | 37 | bool pathRenderingSupport() const { return fPathRenderingSupport; } |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 38 | bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
commit-bot@chromium.org | b835652 | 2013-07-18 22:26:39 +0000 | [diff] [blame] | 39 | bool reuseScratchTextures() const { return fReuseScratchTextures; } |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 40 | |
| 41 | int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
| 42 | int maxTextureSize() const { return fMaxTextureSize; } |
| 43 | // Will be 0 if MSAA is not supported |
| 44 | int maxSampleCount() const { return fMaxSampleCount; } |
| 45 | |
| 46 | protected: |
| 47 | bool f8BitPaletteSupport : 1; |
| 48 | bool fNPOTTextureTileSupport : 1; |
| 49 | bool fTwoSidedStencilSupport : 1; |
| 50 | bool fStencilWrapOpsSupport : 1; |
| 51 | bool fHWAALineSupport : 1; |
| 52 | bool fShaderDerivativeSupport : 1; |
| 53 | bool fGeometryShaderSupport : 1; |
| 54 | bool fDualSourceBlendingSupport : 1; |
| 55 | bool fBufferLockSupport : 1; |
commit-bot@chromium.org | c4dc0ad | 2013-10-09 14:11:33 +0000 | [diff] [blame^] | 56 | bool fPathRenderingSupport : 1; |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 57 | bool fDstReadInShaderSupport : 1; |
commit-bot@chromium.org | b835652 | 2013-07-18 22:26:39 +0000 | [diff] [blame] | 58 | bool fReuseScratchTextures : 1; |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 59 | |
| 60 | int fMaxRenderTargetSize; |
| 61 | int fMaxTextureSize; |
| 62 | int fMaxSampleCount; |
| 63 | |
| 64 | typedef SkRefCnt INHERITED; |
| 65 | }; |
| 66 | |
| 67 | #endif |