OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |