Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/gpu/GrCaps.cpp

Issue 1563443002: Move config texturability/renderability to config table (Closed) Base URL: https://skia.googlesource.com/skia.git@readpixformat
Patch Set: whitespace cleanup Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrCaps.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/gpu/GrCaps.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698