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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 fSupressPrints = options.fSuppressPrints; | 114 fSupressPrints = options.fSuppressPrints; |
115 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 115 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
116 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 116 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
117 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; | 117 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; |
118 | 118 |
119 fPreferVRAMUseOverFlushes = true; | 119 fPreferVRAMUseOverFlushes = true; |
120 } | 120 } |
121 | 121 |
122 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 122 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
123 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); | 123 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); |
| 124 // 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 fMaxTileSize = fMaxTextureSize; |
| 127 } else { |
| 128 fMaxTileSize = options.fMaxTileSizeOverride; |
| 129 } |
124 } | 130 } |
125 | 131 |
126 static SkString map_flags_to_string(uint32_t flags) { | 132 static SkString map_flags_to_string(uint32_t flags) { |
127 SkString str; | 133 SkString str; |
128 if (GrCaps::kNone_MapFlags == flags) { | 134 if (GrCaps::kNone_MapFlags == flags) { |
129 str = "none"; | 135 str = "none"; |
130 } else { | 136 } else { |
131 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 137 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
132 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 138 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
133 str = "can_map"; | 139 str = "can_map"; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 241 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
236 | 242 |
237 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 243 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
238 r.appendf("%s is uploadable to a texture: %s\n", | 244 r.appendf("%s is uploadable to a texture: %s\n", |
239 kConfigNames[i], | 245 kConfigNames[i], |
240 gNY[fConfigTextureSupport[i]]); | 246 gNY[fConfigTextureSupport[i]]); |
241 } | 247 } |
242 | 248 |
243 return r; | 249 return r; |
244 } | 250 } |
OLD | NEW |