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)); |
1032 } | 1033 } |
1033 | 1034 |
1034 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 1035 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
1035 f8BitPaletteSupport = other.f8BitPaletteSupport; | 1036 f8BitPaletteSupport = other.f8BitPaletteSupport; |
1036 fMipMapSupport = other.fMipMapSupport; | 1037 fMipMapSupport = other.fMipMapSupport; |
1037 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 1038 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
1038 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 1039 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
1039 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 1040 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
1040 fHWAALineSupport = other.fHWAALineSupport; | 1041 fHWAALineSupport = other.fHWAALineSupport; |
1041 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | 1042 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
1042 fGeometryShaderSupport = other.fGeometryShaderSupport; | 1043 fGeometryShaderSupport = other.fGeometryShaderSupport; |
1043 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | 1044 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
1044 fPathRenderingSupport = other.fPathRenderingSupport; | 1045 fPathRenderingSupport = other.fPathRenderingSupport; |
1045 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | 1046 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
1046 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 1047 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
1047 fReuseScratchTextures = other.fReuseScratchTextures; | 1048 fReuseScratchTextures = other.fReuseScratchTextures; |
1048 fGpuTracingSupport = other.fGpuTracingSupport; | 1049 fGpuTracingSupport = other.fGpuTracingSupport; |
1049 | 1050 |
1050 fMapBufferFlags = other.fMapBufferFlags; | 1051 fMapBufferFlags = other.fMapBufferFlags; |
1051 | 1052 |
1052 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 1053 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
1053 fMaxTextureSize = other.fMaxTextureSize; | 1054 fMaxTextureSize = other.fMaxTextureSize; |
1054 fMaxSampleCount = other.fMaxSampleCount; | 1055 fMaxSampleCount = other.fMaxSampleCount; |
1055 | 1056 |
1056 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 1057 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
| 1058 memcpy(fCompressedFormatSupport, other.fCompressedFormatSupport, |
| 1059 sizeof(fCompressedFormatSupport)); |
1057 | 1060 |
1058 return *this; | 1061 return *this; |
1059 } | 1062 } |
1060 | 1063 |
1061 static SkString map_flags_to_string(uint32_t flags) { | 1064 static SkString map_flags_to_string(uint32_t flags) { |
1062 SkString str; | 1065 SkString str; |
1063 if (GrDrawTargetCaps::kNone_MapFlags == flags) { | 1066 if (GrDrawTargetCaps::kNone_MapFlags == flags) { |
1064 str = "none"; | 1067 str = "none"; |
1065 } else { | 1068 } else { |
1066 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); | 1069 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); | 1125 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); |
1123 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); | 1126 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); |
1124 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1127 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1125 if (i != kUnknown_GrPixelConfig) { | 1128 if (i != kUnknown_GrPixelConfig) { |
1126 r.appendf("%s is renderable: %s, with MSAA: %s\n", | 1129 r.appendf("%s is renderable: %s, with MSAA: %s\n", |
1127 kConfigNames[i], | 1130 kConfigNames[i], |
1128 gNY[fConfigRenderSupport[i][0]], | 1131 gNY[fConfigRenderSupport[i][0]], |
1129 gNY[fConfigRenderSupport[i][1]]); | 1132 gNY[fConfigRenderSupport[i][1]]); |
1130 } | 1133 } |
1131 } | 1134 } |
| 1135 |
| 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 |
1132 return r; | 1152 return r; |
1133 } | 1153 } |
OLD | NEW |