| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 fMapBufferFlags = kNone_MapFlags; | 105 fMapBufferFlags = kNone_MapFlags; |
| 106 | 106 |
| 107 fMaxRenderTargetSize = 1; | 107 fMaxRenderTargetSize = 1; |
| 108 fMaxTextureSize = 1; | 108 fMaxTextureSize = 1; |
| 109 fMaxSampleCount = 0; | 109 fMaxSampleCount = 0; |
| 110 | 110 |
| 111 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 111 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
| 112 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 112 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 113 | 113 |
| 114 fSupressPrints = options.fSuppressPrints; | 114 fSuppressPrints = options.fSuppressPrints; |
| 115 fImmediateFlush = options.fImmediateMode; |
| 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); |
| 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. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 244 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
| 244 | 245 |
| 245 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 246 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 246 r.appendf("%s is uploadable to a texture: %s\n", | 247 r.appendf("%s is uploadable to a texture: %s\n", |
| 247 kConfigNames[i], | 248 kConfigNames[i], |
| 248 gNY[fConfigTextureSupport[i]]); | 249 gNY[fConfigTextureSupport[i]]); |
| 249 } | 250 } |
| 250 | 251 |
| 251 return r; | 252 return r; |
| 252 } | 253 } |
| OLD | NEW |