OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 | 9 |
10 | 10 |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
974 fGeometryShaderSupport = false; | 974 fGeometryShaderSupport = false; |
975 fDualSourceBlendingSupport = false; | 975 fDualSourceBlendingSupport = false; |
976 fBufferLockSupport = false; | 976 fBufferLockSupport = false; |
977 fPathRenderingSupport = false; | 977 fPathRenderingSupport = false; |
978 fDstReadInShaderSupport = false; | 978 fDstReadInShaderSupport = false; |
979 fReuseScratchTextures = true; | 979 fReuseScratchTextures = true; |
980 | 980 |
981 fMaxRenderTargetSize = 0; | 981 fMaxRenderTargetSize = 0; |
982 fMaxTextureSize = 0; | 982 fMaxTextureSize = 0; |
983 fMaxSampleCount = 0; | 983 fMaxSampleCount = 0; |
984 | |
985 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | |
984 } | 986 } |
985 | 987 |
986 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 988 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
987 f8BitPaletteSupport = other.f8BitPaletteSupport; | 989 f8BitPaletteSupport = other.f8BitPaletteSupport; |
988 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 990 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
989 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 991 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
990 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 992 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
991 fHWAALineSupport = other.fHWAALineSupport; | 993 fHWAALineSupport = other.fHWAALineSupport; |
992 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | 994 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
993 fGeometryShaderSupport = other.fGeometryShaderSupport; | 995 fGeometryShaderSupport = other.fGeometryShaderSupport; |
994 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | 996 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
995 fBufferLockSupport = other.fBufferLockSupport; | 997 fBufferLockSupport = other.fBufferLockSupport; |
996 fPathRenderingSupport = other.fPathRenderingSupport; | 998 fPathRenderingSupport = other.fPathRenderingSupport; |
997 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | 999 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
998 fReuseScratchTextures = other.fReuseScratchTextures; | 1000 fReuseScratchTextures = other.fReuseScratchTextures; |
999 | 1001 |
1000 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 1002 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
1001 fMaxTextureSize = other.fMaxTextureSize; | 1003 fMaxTextureSize = other.fMaxTextureSize; |
1002 fMaxSampleCount = other.fMaxSampleCount; | 1004 fMaxSampleCount = other.fMaxSampleCount; |
1003 | 1005 |
1006 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende rSupport)); | |
1007 | |
1004 return *this; | 1008 return *this; |
1005 } | 1009 } |
1006 | 1010 |
1007 void GrDrawTargetCaps::print() const { | 1011 void GrDrawTargetCaps::print() const { |
1008 static const char* gNY[] = {"NO", "YES"}; | 1012 static const char* gNY[] = {"NO", "YES"}; |
1009 GrPrintf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]); | 1013 GrPrintf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]); |
1010 GrPrintf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]) ; | 1014 GrPrintf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]) ; |
1011 GrPrintf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]) ; | 1015 GrPrintf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]) ; |
1012 GrPrintf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]); | 1016 GrPrintf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]); |
1013 GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); | 1017 GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); |
1014 GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport] ); | 1018 GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport] ); |
1015 GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]); | 1019 GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]); |
1016 GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppor t]); | 1020 GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppor t]); |
1017 GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); | 1021 GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); |
1018 GrPrintf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]); | 1022 GrPrintf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]); |
1019 GrPrintf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]) ; | 1023 GrPrintf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]) ; |
1020 GrPrintf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]); | 1024 GrPrintf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]); |
1021 GrPrintf("Max Texture Size : %d\n", fMaxTextureSize); | 1025 GrPrintf("Max Texture Size : %d\n", fMaxTextureSize); |
1022 GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize); | 1026 GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize); |
1023 GrPrintf("Max Sample Count : %d\n", fMaxSampleCount); | 1027 GrPrintf("Max Sample Count : %d\n", fMaxSampleCount); |
1028 | |
1029 static const char* kConfigNames[] = { | |
1030 "Unknown", // kUnknown_GrPixelConfig | |
1031 "Alpha8", // kAlpha_8_GrPixelConfig, | |
1032 "Index 8", // kIndex_8_GrPixelConfig, | |
1033 "RGB565", // kRGB_565_GrPixelConfig, | |
1034 "RGBA444", // kRGBA_4444_GrPixelConfig, | |
1035 "RGBA8888", // kRGBA_8888_GrPixelConfig, | |
1036 "BGRA8888", // kBGRA_8888_GrPixelConfig, | |
1037 }; | |
1038 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); | |
1039 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); | |
1040 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); | |
1041 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); | |
1042 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); | |
1043 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); | |
1044 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); | |
1045 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); | |
1046 | |
1047 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig]); | |
robertphillips
2013/10/14 14:43:51
Very minor nit: why not start at 1 and skip the if
bsalomon
2013/10/14 14:48:31
I was just thinking that all of the peering into t
robertphillips
2013/10/16 12:12:36
Fair enough
| |
1048 for (int i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | |
1049 if (i != kUnknown_GrPixelConfig) { | |
1050 GrPrintf("%s is renderable: %s\n", kConfigNames[i], gNY[fConfigRende rSupport[i]]); | |
1051 } | |
1052 } | |
1024 } | 1053 } |
OLD | NEW |