OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrCaps.h" | 8 #include "GrCaps.h" |
9 #include "GrContextOptions.h" | 9 #include "GrContextOptions.h" |
10 #include "GrWindowRectangles.h" | 10 #include "GrWindowRectangles.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 134 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
135 this->onApplyOptionsOverrides(options); | 135 this->onApplyOptionsOverrides(options); |
136 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); | 136 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride); |
137 // If the max tile override is zero, it means we should use the max texture
size. | 137 // If the max tile override is zero, it means we should use the max texture
size. |
138 if (!options.fMaxTileSizeOverride || options.fMaxTileSizeOverride > fMaxText
ureSize) { | 138 if (!options.fMaxTileSizeOverride || options.fMaxTileSizeOverride > fMaxText
ureSize) { |
139 fMaxTileSize = fMaxTextureSize; | 139 fMaxTileSize = fMaxTextureSize; |
140 } else { | 140 } else { |
141 fMaxTileSize = options.fMaxTileSizeOverride; | 141 fMaxTileSize = options.fMaxTileSizeOverride; |
142 } | 142 } |
143 if (fMaxWindowRectangles > GrWindowRectangles::kMaxWindows) { | 143 if (fMaxWindowRectangles > GrWindowRectangles::kMaxWindows) { |
144 SkDebugf("WARNING: capping window rectangles at %i. HW advertises suppor
t for %i.\n", | |
145 GrWindowRectangles::kMaxWindows, fMaxWindowRectangles); | |
146 fMaxWindowRectangles = GrWindowRectangles::kMaxWindows; | 144 fMaxWindowRectangles = GrWindowRectangles::kMaxWindows; |
147 } | 145 } |
148 } | 146 } |
149 | 147 |
150 static SkString map_flags_to_string(uint32_t flags) { | 148 static SkString map_flags_to_string(uint32_t flags) { |
151 SkString str; | 149 SkString str; |
152 if (GrCaps::kNone_MapFlags == flags) { | 150 if (GrCaps::kNone_MapFlags == flags) { |
153 str = "none"; | 151 str = "none"; |
154 } else { | 152 } else { |
155 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 153 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 285 |
288 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 286 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
289 GrPixelConfig config = static_cast<GrPixelConfig>(i); | 287 GrPixelConfig config = static_cast<GrPixelConfig>(i); |
290 r.appendf("%s is uploadable to a texture: %s\n", | 288 r.appendf("%s is uploadable to a texture: %s\n", |
291 kConfigNames[i], | 289 kConfigNames[i], |
292 gNY[this->isConfigTexturable(config)]); | 290 gNY[this->isConfigTexturable(config)]); |
293 } | 291 } |
294 | 292 |
295 return r; | 293 return r; |
296 } | 294 } |
OLD | NEW |