| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 fOversizedStencilSupport = false; | 91 fOversizedStencilSupport = false; |
| 92 fTextureBarrierSupport = false; | 92 fTextureBarrierSupport = false; |
| 93 | 93 |
| 94 fUseDrawInsteadOfClear = false; | 94 fUseDrawInsteadOfClear = false; |
| 95 | 95 |
| 96 fBlendEquationSupport = kBasic_BlendEquationSupport; | 96 fBlendEquationSupport = kBasic_BlendEquationSupport; |
| 97 fMapBufferFlags = kNone_MapFlags; | 97 fMapBufferFlags = kNone_MapFlags; |
| 98 | 98 |
| 99 fMaxRenderTargetSize = 0; | 99 fMaxRenderTargetSize = 0; |
| 100 fMaxTextureSize = 0; | 100 fMaxTextureSize = 0; |
| 101 fMinTextureSize = 0; |
| 101 fMaxSampleCount = 0; | 102 fMaxSampleCount = 0; |
| 102 | 103 |
| 103 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 104 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
| 104 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 105 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 105 | 106 |
| 106 fSupressPrints = options.fSuppressPrints; | 107 fSupressPrints = options.fSuppressPrints; |
| 107 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 108 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
| 108 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 109 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
| 109 } | 110 } |
| 110 | 111 |
| 111 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 112 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
| 112 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); | 113 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); |
| 114 fMinTextureSize = SkTMax(fMinTextureSize, options.fMinTextureSizeOverride); |
| 113 } | 115 } |
| 114 | 116 |
| 115 static SkString map_flags_to_string(uint32_t flags) { | 117 static SkString map_flags_to_string(uint32_t flags) { |
| 116 SkString str; | 118 SkString str; |
| 117 if (GrCaps::kNone_MapFlags == flags) { | 119 if (GrCaps::kNone_MapFlags == flags) { |
| 118 str = "none"; | 120 str = "none"; |
| 119 } else { | 121 } else { |
| 120 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 122 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
| 121 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 123 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
| 122 str = "can_map"; | 124 str = "can_map"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 141 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 143 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
| 142 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 144 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
| 143 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 145 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
| 144 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 146 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
| 145 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 147 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
| 146 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 148 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
| 147 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 149 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
| 148 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); | 150 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); |
| 149 | 151 |
| 150 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 152 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
| 153 r.appendf("Min Texture Size : %d\n", fMinTextureSize); |
| 151 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; | 154 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; |
| 152 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); | 155 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); |
| 153 | 156 |
| 154 static const char* kBlendEquationSupportNames[] = { | 157 static const char* kBlendEquationSupportNames[] = { |
| 155 "Basic", | 158 "Basic", |
| 156 "Advanced", | 159 "Advanced", |
| 157 "Advanced Coherent", | 160 "Advanced Coherent", |
| 158 }; | 161 }; |
| 159 GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport); | 162 GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport); |
| 160 GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport); | 163 GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 216 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
| 214 | 217 |
| 215 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 218 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 216 r.appendf("%s is uploadable to a texture: %s\n", | 219 r.appendf("%s is uploadable to a texture: %s\n", |
| 217 kConfigNames[i], | 220 kConfigNames[i], |
| 218 gNY[fConfigTextureSupport[i]]); | 221 gNY[fConfigTextureSupport[i]]); |
| 219 } | 222 } |
| 220 | 223 |
| 221 return r; | 224 return r; |
| 222 } | 225 } |
| OLD | NEW |