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

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

Issue 2355923002: Revert of Clear stencil buffer before using it for drawing (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 * 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
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 auto res = this->onWrapBackendRenderTarget(desc, ownership); 226 return this->onWrapBackendRenderTarget(desc, ownership);
227 if (desc.fStencilBits) {
228 // Our algorithms that use the stencil buffer assume it is
229 // initially cleared.
230 this->clearStencil(res);
231 }
232 return res;
233 } 227 }
234 228
235 GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDe sc& desc) { 229 GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDe sc& desc) {
236 this->handleDirtyContext(); 230 this->handleDirtyContext();
237 if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { 231 if (!(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) {
238 return nullptr; 232 return nullptr;
239 } 233 }
240 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 234 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
241 return nullptr; 235 return nullptr;
242 } 236 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map. 489 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map.
496 if (a[i].x() != b[i].x()) { 490 if (a[i].x() != b[i].x()) {
497 return a[i].x() < b[i].x(); 491 return a[i].x() < b[i].x();
498 } 492 }
499 if (a[i].y() != b[i].y()) { 493 if (a[i].y() != b[i].y()) {
500 return a[i].y() < b[i].y(); 494 return a[i].y() < b[i].y();
501 } 495 }
502 } 496 }
503 return false; // Equal. 497 return false; // Equal.
504 } 498 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698