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