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 #include "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
10 | 10 |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 } | 1045 } |
1046 } | 1046 } |
1047 | 1047 |
1048 /////////////////////////////////////////////////////////////////////////////// | 1048 /////////////////////////////////////////////////////////////////////////////// |
1049 | 1049 |
1050 void GrDrawTargetCaps::reset() { | 1050 void GrDrawTargetCaps::reset() { |
1051 fMipMapSupport = false; | 1051 fMipMapSupport = false; |
1052 fNPOTTextureTileSupport = false; | 1052 fNPOTTextureTileSupport = false; |
1053 fTwoSidedStencilSupport = false; | 1053 fTwoSidedStencilSupport = false; |
1054 fStencilWrapOpsSupport = false; | 1054 fStencilWrapOpsSupport = false; |
1055 fHWAALineSupport = false; | |
1056 fShaderDerivativeSupport = false; | 1055 fShaderDerivativeSupport = false; |
1057 fGeometryShaderSupport = false; | 1056 fGeometryShaderSupport = false; |
1058 fDualSourceBlendingSupport = false; | 1057 fDualSourceBlendingSupport = false; |
1059 fPathRenderingSupport = false; | 1058 fPathRenderingSupport = false; |
1060 fDstReadInShaderSupport = false; | 1059 fDstReadInShaderSupport = false; |
1061 fDiscardRenderTargetSupport = false; | 1060 fDiscardRenderTargetSupport = false; |
1062 fReuseScratchTextures = true; | 1061 fReuseScratchTextures = true; |
1063 fGpuTracingSupport = false; | 1062 fGpuTracingSupport = false; |
1064 fCompressedTexSubImageSupport = false; | 1063 fCompressedTexSubImageSupport = false; |
1065 fOversizedStencilSupport = false; | 1064 fOversizedStencilSupport = false; |
(...skipping 10 matching lines...) Expand all Loading... |
1076 | 1075 |
1077 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 1076 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
1078 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 1077 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
1079 } | 1078 } |
1080 | 1079 |
1081 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 1080 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
1082 fMipMapSupport = other.fMipMapSupport; | 1081 fMipMapSupport = other.fMipMapSupport; |
1083 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 1082 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
1084 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 1083 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
1085 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 1084 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
1086 fHWAALineSupport = other.fHWAALineSupport; | |
1087 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | 1085 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
1088 fGeometryShaderSupport = other.fGeometryShaderSupport; | 1086 fGeometryShaderSupport = other.fGeometryShaderSupport; |
1089 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | 1087 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
1090 fPathRenderingSupport = other.fPathRenderingSupport; | 1088 fPathRenderingSupport = other.fPathRenderingSupport; |
1091 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | 1089 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
1092 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 1090 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
1093 fReuseScratchTextures = other.fReuseScratchTextures; | 1091 fReuseScratchTextures = other.fReuseScratchTextures; |
1094 fGpuTracingSupport = other.fGpuTracingSupport; | 1092 fGpuTracingSupport = other.fGpuTracingSupport; |
1095 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; | 1093 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; |
1096 fOversizedStencilSupport = other.fOversizedStencilSupport; | 1094 fOversizedStencilSupport = other.fOversizedStencilSupport; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 return ""; | 1157 return ""; |
1160 } | 1158 } |
1161 | 1159 |
1162 SkString GrDrawTargetCaps::dump() const { | 1160 SkString GrDrawTargetCaps::dump() const { |
1163 SkString r; | 1161 SkString r; |
1164 static const char* gNY[] = {"NO", "YES"}; | 1162 static const char* gNY[] = {"NO", "YES"}; |
1165 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); | 1163 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); |
1166 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); | 1164 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); |
1167 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 1165 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
1168 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 1166 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
1169 r.appendf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]
); | |
1170 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivative
Support]); | 1167 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivative
Support]); |
1171 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSu
pport]); | 1168 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSu
pport]); |
1172 r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendi
ngSupport]); | 1169 r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendi
ngSupport]); |
1173 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSup
port]); | 1170 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSup
port]); |
1174 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderS
upport]); | 1171 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderS
upport]); |
1175 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 1172 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
1176 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 1173 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
1177 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 1174 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
1178 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 1175 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
1179 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 1176 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 fFloatPrecisions[s][p].fLogRangeLow, | 1246 fFloatPrecisions[s][p].fLogRangeLow, |
1250 fFloatPrecisions[s][p].fLogRangeHigh, | 1247 fFloatPrecisions[s][p].fLogRangeHigh, |
1251 fFloatPrecisions[s][p].fBits); | 1248 fFloatPrecisions[s][p].fBits); |
1252 } | 1249 } |
1253 } | 1250 } |
1254 } | 1251 } |
1255 | 1252 |
1256 return r; | 1253 return r; |
1257 } | 1254 } |
1258 | 1255 |
1259 uint32_t GrDrawTargetCaps::CreateUniqueID() { | |
1260 static int32_t gUniqueID = SK_InvalidUniqueID; | |
1261 uint32_t id; | |
1262 do { | |
1263 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); | |
1264 } while (id == SK_InvalidUniqueID); | |
1265 return id; | |
1266 } | |
1267 | |
1268 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 1256 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
1269 | 1257 |
1270 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, | 1258 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, |
1271 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 1259 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
1272 GrPipelineBuilder::AutoRestoreStencil* ars, | 1260 GrPipelineBuilder::AutoRestoreStencil* ars, |
1273 GrScissorState* scissorState, | 1261 GrScissorState* scissorState, |
1274 const SkRect* devBounds) { | 1262 const SkRect* devBounds) { |
1275 return fClipMaskManager.setupClipping(pipelineBuilder, | 1263 return fClipMaskManager.setupClipping(pipelineBuilder, |
1276 arfp, | 1264 arfp, |
1277 ars, | 1265 ars, |
1278 scissorState, | 1266 scissorState, |
1279 devBounds); | 1267 devBounds); |
1280 } | 1268 } |
OLD | NEW |