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 30 matching lines...) Expand all Loading... |
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); |
124 // If the max tile override is zero, it means we should use the max texture
size. | 125 // If the max tile override is zero, it means we should use the max texture
size. |
125 if (!options.fMaxTileSizeOverride || options.fMaxTileSizeOverride > fMaxText
ureSize) { | 126 if (!options.fMaxTileSizeOverride || options.fMaxTileSizeOverride > fMaxText
ureSize) { |
126 fMaxTileSize = fMaxTextureSize; | 127 fMaxTileSize = fMaxTextureSize; |
127 } else { | 128 } else { |
128 fMaxTileSize = options.fMaxTileSizeOverride; | 129 fMaxTileSize = options.fMaxTileSizeOverride; |
129 } | 130 } |
| 131 this->onApplyOptionsOverrides(options); |
130 } | 132 } |
131 | 133 |
132 static SkString map_flags_to_string(uint32_t flags) { | 134 static SkString map_flags_to_string(uint32_t flags) { |
133 SkString str; | 135 SkString str; |
134 if (GrCaps::kNone_MapFlags == flags) { | 136 if (GrCaps::kNone_MapFlags == flags) { |
135 str = "none"; | 137 str = "none"; |
136 } else { | 138 } else { |
137 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 139 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
138 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 140 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
139 str = "can_map"; | 141 str = "can_map"; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 243 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
242 | 244 |
243 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 245 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
244 r.appendf("%s is uploadable to a texture: %s\n", | 246 r.appendf("%s is uploadable to a texture: %s\n", |
245 kConfigNames[i], | 247 kConfigNames[i], |
246 gNY[fConfigTextureSupport[i]]); | 248 gNY[fConfigTextureSupport[i]]); |
247 } | 249 } |
248 | 250 |
249 return r; | 251 return r; |
250 } | 252 } |
OLD | NEW |