| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 "GrCaps.h" | 9 #include "GrCaps.h" |
| 10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 fMaxTextureSize = 0; | 102 fMaxTextureSize = 0; |
| 103 fMinTextureSize = 0; | 103 fMinTextureSize = 0; |
| 104 fMaxSampleCount = 0; | 104 fMaxSampleCount = 0; |
| 105 | 105 |
| 106 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 106 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
| 107 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 107 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 108 | 108 |
| 109 fSupressPrints = options.fSuppressPrints; | 109 fSupressPrints = options.fSuppressPrints; |
| 110 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 110 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
| 111 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 111 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
| 112 fUseDrawInsteadOfPartialTextureWrite = options.fUseDrawInsteadOfPartialTextu
reWrite; | |
| 113 } | 112 } |
| 114 | 113 |
| 115 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 114 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
| 116 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); | 115 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); |
| 117 fMinTextureSize = SkTMax(fMinTextureSize, options.fMinTextureSizeOverride); | 116 fMinTextureSize = SkTMax(fMinTextureSize, options.fMinTextureSizeOverride); |
| 118 } | 117 } |
| 119 | 118 |
| 120 static SkString map_flags_to_string(uint32_t flags) { | 119 static SkString map_flags_to_string(uint32_t flags) { |
| 121 SkString str; | 120 SkString str; |
| 122 if (GrCaps::kNone_MapFlags == flags) { | 121 if (GrCaps::kNone_MapFlags == flags) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 144 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); | 143 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); |
| 145 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 144 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
| 146 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 145 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
| 147 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 146 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
| 148 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 147 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
| 149 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 148 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
| 150 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 149 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
| 151 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 150 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
| 152 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 151 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
| 153 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); | 152 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); |
| 154 r.appendf("Draw Instead of TexSubImage [workaround] : %s\n", | |
| 155 gNY[fUseDrawInsteadOfPartialTextureWrite]); | |
| 156 if (this->advancedBlendEquationSupport()) { | 153 if (this->advancedBlendEquationSupport()) { |
| 157 r.appendf("Advanced Blend Equation Blacklist : 0x%x\n", fAdvBlendEqBlac
klist); | 154 r.appendf("Advanced Blend Equation Blacklist : 0x%x\n", fAdvBlendEqBlac
klist); |
| 158 } | 155 } |
| 159 | 156 |
| 160 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 157 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
| 161 r.appendf("Min Texture Size : %d\n", fMinTextureSize); | 158 r.appendf("Min Texture Size : %d\n", fMinTextureSize); |
| 162 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; | 159 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; |
| 163 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); | 160 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); |
| 164 | 161 |
| 165 static const char* kBlendEquationSupportNames[] = { | 162 static const char* kBlendEquationSupportNames[] = { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 221 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
| 225 | 222 |
| 226 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 223 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 227 r.appendf("%s is uploadable to a texture: %s\n", | 224 r.appendf("%s is uploadable to a texture: %s\n", |
| 228 kConfigNames[i], | 225 kConfigNames[i], |
| 229 gNY[fConfigTextureSupport[i]]); | 226 gNY[fConfigTextureSupport[i]]); |
| 230 } | 227 } |
| 231 | 228 |
| 232 return r; | 229 return r; |
| 233 } | 230 } |
| OLD | NEW |