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

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

Issue 1592803002: Differentiate maxColorSamples and maxStencilSamples in GrCaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 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 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } else { 117 } else {
118 int maxSize = this->caps()->maxTextureSize(); 118 int maxSize = this->caps()->maxTextureSize();
119 if (desc.fWidth > maxSize || desc.fHeight > maxSize) { 119 if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
120 return nullptr; 120 return nullptr;
121 } 121 }
122 } 122 }
123 123
124 GrGpuResource::LifeCycle lifeCycle = budgeted ? GrGpuResource::kCached_LifeC ycle : 124 GrGpuResource::LifeCycle lifeCycle = budgeted ? GrGpuResource::kCached_LifeC ycle :
125 GrGpuResource::kUncached_Lif eCycle; 125 GrGpuResource::kUncached_Lif eCycle;
126 126
127 desc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount()); 127 // We require the sample count to be less than both the max color sample cou nt and
128 // max stencil sample count supported by the system
129 int maxSampleCount = SkTMin(this->caps()->maxColorSampleCount(),
130 this->caps()->maxStencilSampleCount());
131 desc.fSampleCnt = SkTMin(desc.fSampleCnt, maxSampleCount);
128 // Attempt to catch un- or wrongly initialized sample counts; 132 // Attempt to catch un- or wrongly initialized sample counts;
129 SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64); 133 SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);
130 134
131 desc.fOrigin = resolve_origin(desc.fOrigin, isRT); 135 desc.fOrigin = resolve_origin(desc.fOrigin, isRT);
132 136
133 if (GrPixelConfigIsCompressed(desc.fConfig)) { 137 if (GrPixelConfigIsCompressed(desc.fConfig)) {
134 // We shouldn't be rendering into this 138 // We shouldn't be rendering into this
135 SkASSERT(!isRT); 139 SkASSERT(!isRT);
136 SkASSERT(0 == desc.fSampleCnt); 140 SkASSERT(0 == desc.fSampleCnt);
137 141
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); 379 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
376 } 380 }
377 381
378 GrVertices::Iterator iter; 382 GrVertices::Iterator iter;
379 const GrNonInstancedVertices* verts = iter.init(vertices); 383 const GrNonInstancedVertices* verts = iter.init(vertices);
380 do { 384 do {
381 this->onDraw(args, *verts); 385 this->onDraw(args, *verts);
382 fStats.incNumDraws(); 386 fStats.incNumDraws();
383 } while ((verts = iter.next())); 387 } while ((verts = iter.next()));
384 } 388 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698