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

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

Issue 1158963002: Add caps overrides to GMs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 7 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/GrContextOptions.h ('k') | src/gpu/GrContext.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 fFloatPrecisions[s][p].fLogRangeLow, 66 fFloatPrecisions[s][p].fLogRangeLow,
67 fFloatPrecisions[s][p].fLogRangeHigh, 67 fFloatPrecisions[s][p].fLogRangeHigh,
68 fFloatPrecisions[s][p].fBits); 68 fFloatPrecisions[s][p].fBits);
69 } 69 }
70 } 70 }
71 } 71 }
72 72
73 return r; 73 return r;
74 } 74 }
75 75
76 void GrShaderCaps::applyOptionsOverrides(const GrContextOptions&) {
77 // Currently no overrides apply to shader caps.
78 }
79
76 /////////////////////////////////////////////////////////////////////////////// 80 ///////////////////////////////////////////////////////////////////////////////
77 81
78 GrCaps::GrCaps(const GrContextOptions& options) { 82 GrCaps::GrCaps(const GrContextOptions& options) {
79 fMipMapSupport = false; 83 fMipMapSupport = false;
80 fNPOTTextureTileSupport = false; 84 fNPOTTextureTileSupport = false;
81 fTwoSidedStencilSupport = false; 85 fTwoSidedStencilSupport = false;
82 fStencilWrapOpsSupport = false; 86 fStencilWrapOpsSupport = false;
83 fDiscardRenderTargetSupport = false; 87 fDiscardRenderTargetSupport = false;
84 fReuseScratchTextures = true; 88 fReuseScratchTextures = true;
85 fGpuTracingSupport = false; 89 fGpuTracingSupport = false;
(...skipping 10 matching lines...) Expand all
96 fMaxTextureSize = 0; 100 fMaxTextureSize = 0;
97 fMaxSampleCount = 0; 101 fMaxSampleCount = 0;
98 102
99 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); 103 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport));
100 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); 104 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport));
101 105
102 fSupressPrints = options.fSuppressPrints; 106 fSupressPrints = options.fSuppressPrints;
103 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText ure; 107 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText ure;
104 } 108 }
105 109
110 void GrCaps::applyOptionsOverrides(const GrContextOptions& options) {
111 fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride);
112 }
113
106 static SkString map_flags_to_string(uint32_t flags) { 114 static SkString map_flags_to_string(uint32_t flags) {
107 SkString str; 115 SkString str;
108 if (GrCaps::kNone_MapFlags == flags) { 116 if (GrCaps::kNone_MapFlags == flags) {
109 str = "none"; 117 str = "none";
110 } else { 118 } else {
111 SkASSERT(GrCaps::kCanMap_MapFlag & flags); 119 SkASSERT(GrCaps::kCanMap_MapFlag & flags);
112 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); 120 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag);
113 str = "can_map"; 121 str = "can_map";
114 122
115 if (GrCaps::kSubset_MapFlag & flags) { 123 if (GrCaps::kSubset_MapFlag & flags) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); 212 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]);
205 213
206 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { 214 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) {
207 r.appendf("%s is uploadable to a texture: %s\n", 215 r.appendf("%s is uploadable to a texture: %s\n",
208 kConfigNames[i], 216 kConfigNames[i],
209 gNY[fConfigTextureSupport[i]]); 217 gNY[fConfigTextureSupport[i]]);
210 } 218 }
211 219
212 return r; 220 return r;
213 } 221 }
OLDNEW
« no previous file with comments | « include/gpu/GrContextOptions.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698