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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 fFloatPrecisions[s][p].fBits); | 70 fFloatPrecisions[s][p].fBits); |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 return r; | 75 return r; |
76 } | 76 } |
77 | 77 |
78 void GrShaderCaps::applyOptionsOverrides(const GrContextOptions& options) { | 78 void GrShaderCaps::applyOptionsOverrides(const GrContextOptions& options) { |
79 fDualSourceBlendingSupport = fDualSourceBlendingSupport && !options.fSuppres
sDualSourceBlending; | 79 fDualSourceBlendingSupport = fDualSourceBlendingSupport && !options.fSuppres
sDualSourceBlending; |
| 80 this->onApplyOptionsOverrides(options); |
80 } | 81 } |
81 | 82 |
82 /////////////////////////////////////////////////////////////////////////////// | 83 /////////////////////////////////////////////////////////////////////////////// |
83 | 84 |
84 GrCaps::GrCaps(const GrContextOptions& options) { | 85 GrCaps::GrCaps(const GrContextOptions& options) { |
85 fMipMapSupport = false; | 86 fMipMapSupport = false; |
86 fNPOTTextureTileSupport = false; | 87 fNPOTTextureTileSupport = false; |
87 fTwoSidedStencilSupport = false; | 88 fTwoSidedStencilSupport = false; |
88 fStencilWrapOpsSupport = false; | 89 fStencilWrapOpsSupport = false; |
89 fDiscardRenderTargetSupport = false; | 90 fDiscardRenderTargetSupport = false; |
(...skipping 24 matching lines...) Expand all Loading... |
114 fSupressPrints = options.fSuppressPrints; | 115 fSupressPrints = options.fSuppressPrints; |
115 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 116 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
116 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 117 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
117 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; | 118 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; |
118 | 119 |
119 fPreferVRAMUseOverFlushes = true; | 120 fPreferVRAMUseOverFlushes = true; |
120 } | 121 } |
121 | 122 |
122 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 123 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
123 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); | 124 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); |
| 125 this->onApplyOptionsOverrides(options); |
124 } | 126 } |
125 | 127 |
126 static SkString map_flags_to_string(uint32_t flags) { | 128 static SkString map_flags_to_string(uint32_t flags) { |
127 SkString str; | 129 SkString str; |
128 if (GrCaps::kNone_MapFlags == flags) { | 130 if (GrCaps::kNone_MapFlags == flags) { |
129 str = "none"; | 131 str = "none"; |
130 } else { | 132 } else { |
131 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 133 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
132 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 134 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
133 str = "can_map"; | 135 str = "can_map"; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 237 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
236 | 238 |
237 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 239 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
238 r.appendf("%s is uploadable to a texture: %s\n", | 240 r.appendf("%s is uploadable to a texture: %s\n", |
239 kConfigNames[i], | 241 kConfigNames[i], |
240 gNY[fConfigTextureSupport[i]]); | 242 gNY[fConfigTextureSupport[i]]); |
241 } | 243 } |
242 | 244 |
243 return r; | 245 return r; |
244 } | 246 } |
OLD | NEW |