OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 return tex; | 216 return tex; |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc, | 220 GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc, |
221 GrWrapOwnership ownership) { | 221 GrWrapOwnership ownership) { |
222 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { | 222 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { |
223 return nullptr; | 223 return nullptr; |
224 } | 224 } |
225 this->handleDirtyContext(); | 225 this->handleDirtyContext(); |
226 return this->onWrapBackendRenderTarget(desc, ownership); | 226 auto res = this->onWrapBackendRenderTarget(desc, ownership); |
227 if (desc.fStencilBits) { | |
bsalomon
2016/09/16 13:46:21
Can we have a comment something to the effect of:
| |
228 this->clearStencil(res); | |
229 } | |
230 return res; | |
227 } | 231 } |
228 | 232 |
229 GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDe sc& desc) { | 233 GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDe sc& desc) { |
230 this->handleDirtyContext(); | 234 this->handleDirtyContext(); |
231 if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { | 235 if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { |
232 return nullptr; | 236 return nullptr; |
233 } | 237 } |
234 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { | 238 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { |
235 return nullptr; | 239 return nullptr; |
236 } | 240 } |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map. | 493 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map. |
490 if (a[i].x() != b[i].x()) { | 494 if (a[i].x() != b[i].x()) { |
491 return a[i].x() < b[i].x(); | 495 return a[i].x() < b[i].x(); |
492 } | 496 } |
493 if (a[i].y() != b[i].y()) { | 497 if (a[i].y() != b[i].y()) { |
494 return a[i].y() < b[i].y(); | 498 return a[i].y() < b[i].y(); |
495 } | 499 } |
496 } | 500 } |
497 return false; // Equal. | 501 return false; // Equal. |
498 } | 502 } |
OLD | NEW |