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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 fNPOTTextureTileSupport = false; | 1012 fNPOTTextureTileSupport = false; |
1013 fTwoSidedStencilSupport = false; | 1013 fTwoSidedStencilSupport = false; |
1014 fStencilWrapOpsSupport = false; | 1014 fStencilWrapOpsSupport = false; |
1015 fHWAALineSupport = false; | 1015 fHWAALineSupport = false; |
1016 fShaderDerivativeSupport = false; | 1016 fShaderDerivativeSupport = false; |
1017 fGeometryShaderSupport = false; | 1017 fGeometryShaderSupport = false; |
1018 fDualSourceBlendingSupport = false; | 1018 fDualSourceBlendingSupport = false; |
1019 fBufferLockSupport = false; | 1019 fBufferLockSupport = false; |
1020 fPathRenderingSupport = false; | 1020 fPathRenderingSupport = false; |
1021 fDstReadInShaderSupport = false; | 1021 fDstReadInShaderSupport = false; |
| 1022 fDiscardRenderTargetSupport = false; |
1022 fReuseScratchTextures = true; | 1023 fReuseScratchTextures = true; |
1023 fGpuTracingSupport = false; | 1024 fGpuTracingSupport = false; |
1024 | 1025 |
1025 fMaxRenderTargetSize = 0; | 1026 fMaxRenderTargetSize = 0; |
1026 fMaxTextureSize = 0; | 1027 fMaxTextureSize = 0; |
1027 fMaxSampleCount = 0; | 1028 fMaxSampleCount = 0; |
1028 | 1029 |
1029 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 1030 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
1030 } | 1031 } |
1031 | 1032 |
1032 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 1033 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
1033 f8BitPaletteSupport = other.f8BitPaletteSupport; | 1034 f8BitPaletteSupport = other.f8BitPaletteSupport; |
1034 fMipMapSupport = other.fMipMapSupport; | 1035 fMipMapSupport = other.fMipMapSupport; |
1035 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 1036 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
1036 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 1037 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
1037 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 1038 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
1038 fHWAALineSupport = other.fHWAALineSupport; | 1039 fHWAALineSupport = other.fHWAALineSupport; |
1039 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | 1040 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
1040 fGeometryShaderSupport = other.fGeometryShaderSupport; | 1041 fGeometryShaderSupport = other.fGeometryShaderSupport; |
1041 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | 1042 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
1042 fBufferLockSupport = other.fBufferLockSupport; | 1043 fBufferLockSupport = other.fBufferLockSupport; |
1043 fPathRenderingSupport = other.fPathRenderingSupport; | 1044 fPathRenderingSupport = other.fPathRenderingSupport; |
1044 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | 1045 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
| 1046 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
1045 fReuseScratchTextures = other.fReuseScratchTextures; | 1047 fReuseScratchTextures = other.fReuseScratchTextures; |
1046 fGpuTracingSupport = other.fGpuTracingSupport; | 1048 fGpuTracingSupport = other.fGpuTracingSupport; |
1047 | 1049 |
1048 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 1050 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
1049 fMaxTextureSize = other.fMaxTextureSize; | 1051 fMaxTextureSize = other.fMaxTextureSize; |
1050 fMaxSampleCount = other.fMaxSampleCount; | 1052 fMaxSampleCount = other.fMaxSampleCount; |
1051 | 1053 |
1052 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 1054 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
1053 | 1055 |
1054 return *this; | 1056 return *this; |
1055 } | 1057 } |
1056 | 1058 |
1057 SkString GrDrawTargetCaps::dump() const { | 1059 SkString GrDrawTargetCaps::dump() const { |
1058 SkString r; | 1060 SkString r; |
1059 static const char* gNY[] = {"NO", "YES"}; | 1061 static const char* gNY[] = {"NO", "YES"}; |
1060 r.appendf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]); | 1062 r.appendf("8 Bit Palette Support : %s\n", gNY[f8BitPaletteSupport]); |
1061 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); | 1063 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); |
1062 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport]
); | 1064 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileSupport
]); |
1063 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport]
); | 1065 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilSupport
]); |
1064 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport])
; | 1066 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSupport]
); |
1065 r.appendf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); | 1067 r.appendf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); |
1066 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport
]); | 1068 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSuppor
t]); |
1067 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport])
; | 1069 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]
); |
1068 r.appendf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppo
rt]); | 1070 r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendingSupp
ort]); |
1069 r.appendf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); | 1071 r.appendf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); |
1070 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport]); | 1072 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSupport])
; |
1071 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport]
); | 1073 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderSupport
]); |
1072 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]); | 1074 r.appendf("Discard Render Target Support: %s\n", gNY[fDiscardRenderTargetSup
port]); |
1073 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSupport]); | 1075 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures])
; |
1074 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 1076 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSupport]); |
1075 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize); | 1077 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
1076 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); | 1078 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize); |
| 1079 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); |
1077 | 1080 |
1078 static const char* kConfigNames[] = { | 1081 static const char* kConfigNames[] = { |
1079 "Unknown", // kUnknown_GrPixelConfig | 1082 "Unknown", // kUnknown_GrPixelConfig |
1080 "Alpha8", // kAlpha_8_GrPixelConfig, | 1083 "Alpha8", // kAlpha_8_GrPixelConfig, |
1081 "Index8", // kIndex_8_GrPixelConfig, | 1084 "Index8", // kIndex_8_GrPixelConfig, |
1082 "RGB565", // kRGB_565_GrPixelConfig, | 1085 "RGB565", // kRGB_565_GrPixelConfig, |
1083 "RGBA444", // kRGBA_4444_GrPixelConfig, | 1086 "RGBA444", // kRGBA_4444_GrPixelConfig, |
1084 "RGBA8888", // kRGBA_8888_GrPixelConfig, | 1087 "RGBA8888", // kRGBA_8888_GrPixelConfig, |
1085 "BGRA8888", // kBGRA_8888_GrPixelConfig, | 1088 "BGRA8888", // kBGRA_8888_GrPixelConfig, |
1086 }; | 1089 }; |
(...skipping 11 matching lines...) Expand all Loading... |
1098 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1101 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1099 if (i != kUnknown_GrPixelConfig) { | 1102 if (i != kUnknown_GrPixelConfig) { |
1100 r.appendf("%s is renderable: %s, with MSAA: %s\n", | 1103 r.appendf("%s is renderable: %s, with MSAA: %s\n", |
1101 kConfigNames[i], | 1104 kConfigNames[i], |
1102 gNY[fConfigRenderSupport[i][0]], | 1105 gNY[fConfigRenderSupport[i][0]], |
1103 gNY[fConfigRenderSupport[i][1]]); | 1106 gNY[fConfigRenderSupport[i][1]]); |
1104 } | 1107 } |
1105 } | 1108 } |
1106 return r; | 1109 return r; |
1107 } | 1110 } |
OLD | NEW |