| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 fBlendEquationSupport = kBasic_BlendEquationSupport; | 100 fBlendEquationSupport = kBasic_BlendEquationSupport; |
| 101 fAdvBlendEqBlacklist = 0; | 101 fAdvBlendEqBlacklist = 0; |
| 102 | 102 |
| 103 fMapBufferFlags = kNone_MapFlags; | 103 fMapBufferFlags = kNone_MapFlags; |
| 104 | 104 |
| 105 fMaxRenderTargetSize = 1; | 105 fMaxRenderTargetSize = 1; |
| 106 fMaxTextureSize = 1; | 106 fMaxTextureSize = 1; |
| 107 fMaxSampleCount = 0; | 107 fMaxSampleCount = 0; |
| 108 | 108 |
| 109 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | |
| 110 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | |
| 111 | |
| 112 fSuppressPrints = options.fSuppressPrints; | 109 fSuppressPrints = options.fSuppressPrints; |
| 113 fImmediateFlush = options.fImmediateMode; | 110 fImmediateFlush = options.fImmediateMode; |
| 114 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; | 111 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
| 115 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; | 112 fGeometryBufferMapThreshold = options.fGeometryBufferMapThreshold; |
| 116 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; | 113 fUseDrawInsteadOfPartialRenderTargetWrite = options.fUseDrawInsteadOfPartial
RenderTargetWrite; |
| 117 | 114 |
| 118 fPreferVRAMUseOverFlushes = true; | 115 fPreferVRAMUseOverFlushes = true; |
| 119 } | 116 } |
| 120 | 117 |
| 121 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { | 118 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig); | 219 GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig); |
| 223 GR_STATIC_ASSERT(8 == kETC1_GrPixelConfig); | 220 GR_STATIC_ASSERT(8 == kETC1_GrPixelConfig); |
| 224 GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig); | 221 GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig); |
| 225 GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig); | 222 GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig); |
| 226 GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig); | 223 GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig); |
| 227 GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig); | 224 GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig); |
| 228 GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig); | 225 GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig); |
| 229 GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig); | 226 GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig); |
| 230 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); | 227 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); |
| 231 | 228 |
| 232 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); | 229 SkASSERT(!this->isConfigRenderable(kUnknown_GrPixelConfig, false)); |
| 233 SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); | 230 SkASSERT(!this->isConfigRenderable(kUnknown_GrPixelConfig, true)); |
| 234 | 231 |
| 235 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 232 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 233 GrPixelConfig config = static_cast<GrPixelConfig>(i); |
| 236 r.appendf("%s is renderable: %s, with MSAA: %s\n", | 234 r.appendf("%s is renderable: %s, with MSAA: %s\n", |
| 237 kConfigNames[i], | 235 kConfigNames[i], |
| 238 gNY[fConfigRenderSupport[i][0]], | 236 gNY[this->isConfigRenderable(config, false)], |
| 239 gNY[fConfigRenderSupport[i][1]]); | 237 gNY[this->isConfigRenderable(config, true)]); |
| 240 } | 238 } |
| 241 | 239 |
| 242 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 240 SkASSERT(!this->isConfigTexturable(kUnknown_GrPixelConfig)); |
| 243 | 241 |
| 244 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 242 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 243 GrPixelConfig config = static_cast<GrPixelConfig>(i); |
| 245 r.appendf("%s is uploadable to a texture: %s\n", | 244 r.appendf("%s is uploadable to a texture: %s\n", |
| 246 kConfigNames[i], | 245 kConfigNames[i], |
| 247 gNY[fConfigTextureSupport[i]]); | 246 gNY[this->isConfigTexturable(config)]); |
| 248 } | 247 } |
| 249 | 248 |
| 250 return r; | 249 return r; |
| 251 } | 250 } |
| OLD | NEW |