Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/gpu/GrDrawTargetCaps.h

Issue 102853005: Add detection of mip support (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove extra space Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10 matching lines...) Expand all
21 21
22 GrDrawTargetCaps() { this->reset(); } 22 GrDrawTargetCaps() { this->reset(); }
23 GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = othe r; } 23 GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = othe r; }
24 GrDrawTargetCaps& operator= (const GrDrawTargetCaps&); 24 GrDrawTargetCaps& operator= (const GrDrawTargetCaps&);
25 25
26 virtual void reset(); 26 virtual void reset();
27 virtual SkString dump() const; 27 virtual SkString dump() const;
28 28
29 bool eightBitPaletteSupport() const { return f8BitPaletteSupport; } 29 bool eightBitPaletteSupport() const { return f8BitPaletteSupport; }
30 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } 30 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; }
31 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor t of MIP Maps (e.g.
32 only for POT textures) */
33 bool mipMapSupport() const { return fMipMapSupport; }
31 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } 34 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; }
32 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } 35 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; }
33 bool hwAALineSupport() const { return fHWAALineSupport; } 36 bool hwAALineSupport() const { return fHWAALineSupport; }
34 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } 37 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; }
35 bool geometryShaderSupport() const { return fGeometryShaderSupport; } 38 bool geometryShaderSupport() const { return fGeometryShaderSupport; }
36 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; } 39 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
37 bool bufferLockSupport() const { return fBufferLockSupport; } 40 bool bufferLockSupport() const { return fBufferLockSupport; }
38 bool pathRenderingSupport() const { return fPathRenderingSupport; } 41 bool pathRenderingSupport() const { return fPathRenderingSupport; }
39 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } 42 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
40 43
41 // Scratch textures not being reused means that those scratch textures 44 // Scratch textures not being reused means that those scratch textures
42 // that we upload to (i.e., don't have a render target) will not be 45 // that we upload to (i.e., don't have a render target) will not be
43 // recycled in the texture cache. This is to prevent ghosting by drivers 46 // recycled in the texture cache. This is to prevent ghosting by drivers
44 // (in particular for deferred architectures). 47 // (in particular for deferred architectures).
45 bool reuseScratchTextures() const { return fReuseScratchTextures; } 48 bool reuseScratchTextures() const { return fReuseScratchTextures; }
46 49
47 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } 50 int maxRenderTargetSize() const { return fMaxRenderTargetSize; }
48 int maxTextureSize() const { return fMaxTextureSize; } 51 int maxTextureSize() const { return fMaxTextureSize; }
49 // Will be 0 if MSAA is not supported 52 // Will be 0 if MSAA is not supported
50 int maxSampleCount() const { return fMaxSampleCount; } 53 int maxSampleCount() const { return fMaxSampleCount; }
51 54
52 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { 55 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const {
53 SkASSERT(kGrPixelConfigCnt > config); 56 SkASSERT(kGrPixelConfigCnt > config);
54 return fConfigRenderSupport[config][withMSAA]; 57 return fConfigRenderSupport[config][withMSAA];
55 } 58 }
56 59
57 protected: 60 protected:
58 bool f8BitPaletteSupport : 1; 61 bool f8BitPaletteSupport : 1;
59 bool fNPOTTextureTileSupport : 1; 62 bool fNPOTTextureTileSupport : 1;
63 bool fMipMapSupport : 1;
60 bool fTwoSidedStencilSupport : 1; 64 bool fTwoSidedStencilSupport : 1;
61 bool fStencilWrapOpsSupport : 1; 65 bool fStencilWrapOpsSupport : 1;
62 bool fHWAALineSupport : 1; 66 bool fHWAALineSupport : 1;
63 bool fShaderDerivativeSupport : 1; 67 bool fShaderDerivativeSupport : 1;
64 bool fGeometryShaderSupport : 1; 68 bool fGeometryShaderSupport : 1;
65 bool fDualSourceBlendingSupport : 1; 69 bool fDualSourceBlendingSupport : 1;
66 bool fBufferLockSupport : 1; 70 bool fBufferLockSupport : 1;
67 bool fPathRenderingSupport : 1; 71 bool fPathRenderingSupport : 1;
68 bool fDstReadInShaderSupport : 1; 72 bool fDstReadInShaderSupport : 1;
69 bool fReuseScratchTextures : 1; 73 bool fReuseScratchTextures : 1;
70 74
71 int fMaxRenderTargetSize; 75 int fMaxRenderTargetSize;
72 int fMaxTextureSize; 76 int fMaxTextureSize;
73 int fMaxSampleCount; 77 int fMaxSampleCount;
74 78
75 // The first entry for each config is without msaa and the second is with. 79 // The first entry for each config is without msaa and the second is with.
76 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; 80 bool fConfigRenderSupport[kGrPixelConfigCnt][2];
77 81
78 typedef SkRefCnt INHERITED; 82 typedef SkRefCnt INHERITED;
79 }; 83 };
80 84
81 #endif 85 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698