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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 fReuseScratchTextures = true; | 1022 fReuseScratchTextures = true; |
1023 fGpuTracingSupport = false; | 1023 fGpuTracingSupport = false; |
1024 | 1024 |
1025 fMapBufferFlags = kNone_MapFlags; | 1025 fMapBufferFlags = kNone_MapFlags; |
1026 | 1026 |
1027 fMaxRenderTargetSize = 0; | 1027 fMaxRenderTargetSize = 0; |
1028 fMaxTextureSize = 0; | 1028 fMaxTextureSize = 0; |
1029 fMaxSampleCount = 0; | 1029 fMaxSampleCount = 0; |
1030 | 1030 |
1031 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 1031 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
1032 memset(fCompressedFormatSupport, 0, sizeof(fCompressedFormatSupport)); | |
1033 } | 1032 } |
1034 | 1033 |
1035 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 1034 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
1036 f8BitPaletteSupport = other.f8BitPaletteSupport; | 1035 f8BitPaletteSupport = other.f8BitPaletteSupport; |
1037 fMipMapSupport = other.fMipMapSupport; | 1036 fMipMapSupport = other.fMipMapSupport; |
1038 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 1037 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
1039 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 1038 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
1040 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 1039 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
1041 fHWAALineSupport = other.fHWAALineSupport; | 1040 fHWAALineSupport = other.fHWAALineSupport; |
1042 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | 1041 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
1043 fGeometryShaderSupport = other.fGeometryShaderSupport; | 1042 fGeometryShaderSupport = other.fGeometryShaderSupport; |
1044 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | 1043 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
1045 fPathRenderingSupport = other.fPathRenderingSupport; | 1044 fPathRenderingSupport = other.fPathRenderingSupport; |
1046 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | 1045 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
1047 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 1046 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
1048 fReuseScratchTextures = other.fReuseScratchTextures; | 1047 fReuseScratchTextures = other.fReuseScratchTextures; |
1049 fGpuTracingSupport = other.fGpuTracingSupport; | 1048 fGpuTracingSupport = other.fGpuTracingSupport; |
1050 | 1049 |
1051 fMapBufferFlags = other.fMapBufferFlags; | 1050 fMapBufferFlags = other.fMapBufferFlags; |
1052 | 1051 |
1053 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 1052 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
1054 fMaxTextureSize = other.fMaxTextureSize; | 1053 fMaxTextureSize = other.fMaxTextureSize; |
1055 fMaxSampleCount = other.fMaxSampleCount; | 1054 fMaxSampleCount = other.fMaxSampleCount; |
1056 | 1055 |
1057 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 1056 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
1058 memcpy(fCompressedFormatSupport, other.fCompressedFormatSupport, | |
1059 sizeof(fCompressedFormatSupport)); | |
1060 | 1057 |
1061 return *this; | 1058 return *this; |
1062 } | 1059 } |
1063 | 1060 |
1064 static SkString map_flags_to_string(uint32_t flags) { | 1061 static SkString map_flags_to_string(uint32_t flags) { |
1065 SkString str; | 1062 SkString str; |
1066 if (GrDrawTargetCaps::kNone_MapFlags == flags) { | 1063 if (GrDrawTargetCaps::kNone_MapFlags == flags) { |
1067 str = "none"; | 1064 str = "none"; |
1068 } else { | 1065 } else { |
1069 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); | 1066 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 r.appendf("Map Buffer Support : %s\n", map_flags_to_string(fMapBuf
ferFlags).c_str()); | 1102 r.appendf("Map Buffer Support : %s\n", map_flags_to_string(fMapBuf
ferFlags).c_str()); |
1106 | 1103 |
1107 static const char* kConfigNames[] = { | 1104 static const char* kConfigNames[] = { |
1108 "Unknown", // kUnknown_GrPixelConfig | 1105 "Unknown", // kUnknown_GrPixelConfig |
1109 "Alpha8", // kAlpha_8_GrPixelConfig, | 1106 "Alpha8", // kAlpha_8_GrPixelConfig, |
1110 "Index8", // kIndex_8_GrPixelConfig, | 1107 "Index8", // kIndex_8_GrPixelConfig, |
1111 "RGB565", // kRGB_565_GrPixelConfig, | 1108 "RGB565", // kRGB_565_GrPixelConfig, |
1112 "RGBA444", // kRGBA_4444_GrPixelConfig, | 1109 "RGBA444", // kRGBA_4444_GrPixelConfig, |
1113 "RGBA8888", // kRGBA_8888_GrPixelConfig, | 1110 "RGBA8888", // kRGBA_8888_GrPixelConfig, |
1114 "BGRA8888", // kBGRA_8888_GrPixelConfig, | 1111 "BGRA8888", // kBGRA_8888_GrPixelConfig, |
| 1112 "ETC1", // kETC1_GrPixelConfig, |
| 1113 "LATC", // kLATC_GrPixelConfig, |
1115 }; | 1114 }; |
1116 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); | 1115 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); |
1117 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); | 1116 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); |
1118 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); | 1117 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); |
1119 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); | 1118 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); |
1120 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); | 1119 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); |
1121 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); | 1120 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); |
1122 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); | 1121 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); |
| 1122 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); |
| 1123 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); |
1123 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); | 1124 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); |
1124 | 1125 |
1125 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); | 1126 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); |
1126 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); | 1127 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); |
1127 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1128 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1128 if (i != kUnknown_GrPixelConfig) { | 1129 if (i != kUnknown_GrPixelConfig) { |
1129 r.appendf("%s is renderable: %s, with MSAA: %s\n", | 1130 r.appendf("%s is renderable: %s, with MSAA: %s\n", |
1130 kConfigNames[i], | 1131 kConfigNames[i], |
1131 gNY[fConfigRenderSupport[i][0]], | 1132 gNY[fConfigRenderSupport[i][0]], |
1132 gNY[fConfigRenderSupport[i][1]]); | 1133 gNY[fConfigRenderSupport[i][1]]); |
1133 } | 1134 } |
1134 } | 1135 } |
1135 | 1136 |
1136 static const char* kCompressedFormatNames[] = { | |
1137 "ETC1", // kETC1_GrCompressedFormat | |
1138 "ETC2", // kETC2_GrCompressedFormat, | |
1139 "DXT1", // kDXT1_GrCompressedFormat, | |
1140 }; | |
1141 GR_STATIC_ASSERT(0 == kETC1_GrCompressedFormat); | |
1142 GR_STATIC_ASSERT(1 == kETC2_GrCompressedFormat); | |
1143 GR_STATIC_ASSERT(2 == kDXT1_GrCompressedFormat); | |
1144 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCompressedFormatNames) == kGrCompressedForm
atCount); | |
1145 | |
1146 for (size_t i = 0; i < SK_ARRAY_COUNT(kCompressedFormatNames); ++i) { | |
1147 r.appendf("%s Compressed Texture Support: %s\n", | |
1148 kCompressedFormatNames[i], | |
1149 gNY[fCompressedFormatSupport[i]]); | |
1150 } | |
1151 | |
1152 return r; | 1137 return r; |
1153 } | 1138 } |
OLD | NEW |