| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrCaps.h" | 8 #include "GrCaps.h" |
| 9 #include "GrContextOptions.h" | 9 #include "GrContextOptions.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 fDualSourceBlendingSupport = fDualSourceBlendingSupport && !options.fSuppres
sDualSourceBlending; | 78 fDualSourceBlendingSupport = fDualSourceBlendingSupport && !options.fSuppres
sDualSourceBlending; |
| 79 this->onApplyOptionsOverrides(options); | 79 this->onApplyOptionsOverrides(options); |
| 80 } | 80 } |
| 81 | 81 |
| 82 /////////////////////////////////////////////////////////////////////////////// | 82 /////////////////////////////////////////////////////////////////////////////// |
| 83 | 83 |
| 84 GrCaps::GrCaps(const GrContextOptions& options) { | 84 GrCaps::GrCaps(const GrContextOptions& options) { |
| 85 fMipMapSupport = false; | 85 fMipMapSupport = false; |
| 86 fNPOTTextureTileSupport = false; | 86 fNPOTTextureTileSupport = false; |
| 87 fSRGBSupport = false; | 87 fSRGBSupport = false; |
| 88 fSRGBWriteControl = false; |
| 88 fTwoSidedStencilSupport = false; | 89 fTwoSidedStencilSupport = false; |
| 89 fStencilWrapOpsSupport = false; | 90 fStencilWrapOpsSupport = false; |
| 90 fDiscardRenderTargetSupport = false; | 91 fDiscardRenderTargetSupport = false; |
| 91 fReuseScratchTextures = true; | 92 fReuseScratchTextures = true; |
| 92 fReuseScratchBuffers = true; | 93 fReuseScratchBuffers = true; |
| 93 fGpuTracingSupport = false; | 94 fGpuTracingSupport = false; |
| 94 fCompressedTexSubImageSupport = false; | 95 fCompressedTexSubImageSupport = false; |
| 95 fOversizedStencilSupport = false; | 96 fOversizedStencilSupport = false; |
| 96 fTextureBarrierSupport = false; | 97 fTextureBarrierSupport = false; |
| 97 fSampleLocationsSupport = false; | 98 fSampleLocationsSupport = false; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 SkASSERT(0 == flags); // Make sure we handled all the flags. | 156 SkASSERT(0 == flags); // Make sure we handled all the flags. |
| 156 return str; | 157 return str; |
| 157 } | 158 } |
| 158 | 159 |
| 159 SkString GrCaps::dump() const { | 160 SkString GrCaps::dump() const { |
| 160 SkString r; | 161 SkString r; |
| 161 static const char* gNY[] = {"NO", "YES"}; | 162 static const char* gNY[] = {"NO", "YES"}; |
| 162 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); | 163 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); |
| 163 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); | 164 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); |
| 164 r.appendf("sRGB Support : %s\n", gNY[fSRGBSupport]); | 165 r.appendf("sRGB Support : %s\n", gNY[fSRGBSupport]); |
| 166 r.appendf("sRGB Write Control : %s\n", gNY[fSRGBWriteControl
]); |
| 165 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 167 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
| 166 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 168 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
| 167 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 169 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
| 168 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 170 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
| 169 r.appendf("Reuse Scratch Buffers : %s\n", gNY[fReuseScratchBuff
ers]); | 171 r.appendf("Reuse Scratch Buffers : %s\n", gNY[fReuseScratchBuff
ers]); |
| 170 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 172 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
| 171 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 173 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
| 172 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 174 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
| 173 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 175 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
| 174 r.appendf("Sample Locations Support : %s\n", gNY[fSampleLocationsS
upport]); | 176 r.appendf("Sample Locations Support : %s\n", gNY[fSampleLocationsS
upport]); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 260 |
| 259 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 261 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 260 GrPixelConfig config = static_cast<GrPixelConfig>(i); | 262 GrPixelConfig config = static_cast<GrPixelConfig>(i); |
| 261 r.appendf("%s is uploadable to a texture: %s\n", | 263 r.appendf("%s is uploadable to a texture: %s\n", |
| 262 kConfigNames[i], | 264 kConfigNames[i], |
| 263 gNY[this->isConfigTexturable(config)]); | 265 gNY[this->isConfigTexturable(config)]); |
| 264 } | 266 } |
| 265 | 267 |
| 266 return r; | 268 return r; |
| 267 } | 269 } |
| OLD | NEW |