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

Side by Side Diff: tools/gpu/gl/debug/DebugGLTestContext.cpp

Issue 2085553004: Don't track FB depth attachment in debug GL context (Closed) Base URL: https://skia.googlesource.com/skia.git@fix_testing
Patch Set: Created 4 years, 6 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 | tools/gpu/gl/debug/GrFrameBufferObj.h » ('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 2012 Google Inc. 3 * Copyright 2012 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 "DebugGLTestContext.h" 9 #include "DebugGLTestContext.h"
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (this->getFrameBuffer()) { 256 if (this->getFrameBuffer()) {
257 257
258 GrFrameBufferObj *frameBuffer = this->getFrameBuffer(); 258 GrFrameBufferObj *frameBuffer = this->getFrameBuffer();
259 259
260 for (int i = 0; i < n; ++i) { 260 for (int i = 0; i < n; ++i) {
261 261
262 if (frameBuffer->getColor() && 262 if (frameBuffer->getColor() &&
263 textures[i] == frameBuffer->getColor()->getID()) { 263 textures[i] == frameBuffer->getColor()->getID()) {
264 frameBuffer->setColor(nullptr); 264 frameBuffer->setColor(nullptr);
265 } 265 }
266 if (frameBuffer->getDepth() &&
267 textures[i] == frameBuffer->getDepth()->getID()) {
268 frameBuffer->setDepth(nullptr);
269 }
270 if (frameBuffer->getStencil() && 266 if (frameBuffer->getStencil() &&
271 textures[i] == frameBuffer->getStencil()->getID()) { 267 textures[i] == frameBuffer->getStencil()->getID()) {
272 frameBuffer->setStencil(nullptr); 268 frameBuffer->setStencil(nullptr);
273 } 269 }
274 } 270 }
275 } 271 }
276 272
277 // then actually "delete" the buffers 273 // then actually "delete" the buffers
278 for (int i = 0; i < n; ++i) { 274 for (int i = 0; i < n; ++i) {
279 GrTextureObj *buffer = FIND(textures[i], GrTextureObj, kTexture_ObjT ypes); 275 GrTextureObj *buffer = FIND(textures[i], GrTextureObj, kTexture_ObjT ypes);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (this->getFrameBuffer()) { 331 if (this->getFrameBuffer()) {
336 332
337 GrFrameBufferObj *frameBuffer = this->getFrameBuffer(); 333 GrFrameBufferObj *frameBuffer = this->getFrameBuffer();
338 334
339 for (int i = 0; i < n; ++i) { 335 for (int i = 0; i < n; ++i) {
340 336
341 if (frameBuffer->getColor() && 337 if (frameBuffer->getColor() &&
342 renderBuffers[i] == frameBuffer->getColor()->getID()) { 338 renderBuffers[i] == frameBuffer->getColor()->getID()) {
343 frameBuffer->setColor(nullptr); 339 frameBuffer->setColor(nullptr);
344 } 340 }
345 if (frameBuffer->getDepth() &&
346 renderBuffers[i] == frameBuffer->getDepth()->getID()) {
347 frameBuffer->setDepth(nullptr);
348 }
349 if (frameBuffer->getStencil() && 341 if (frameBuffer->getStencil() &&
350 renderBuffers[i] == frameBuffer->getStencil()->getID()) { 342 renderBuffers[i] == frameBuffer->getStencil()->getID()) {
351 frameBuffer->setStencil(nullptr); 343 frameBuffer->setStencil(nullptr);
352 } 344 }
353 } 345 }
354 } 346 }
355 347
356 // then actually "delete" the buffers 348 // then actually "delete" the buffers
357 for (int i = 0; i < n; ++i) { 349 for (int i = 0; i < n; ++i) {
358 GrRenderBufferObj *buffer = FIND(renderBuffers[i], GrRenderBufferObj , 350 GrRenderBufferObj *buffer = FIND(renderBuffers[i], GrRenderBufferObj ,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 382
391 // a renderBufferID of 0 is acceptable - it unbinds the current 383 // a renderBufferID of 0 is acceptable - it unbinds the current
392 // render buffer 384 // render buffer
393 GrRenderBufferObj *renderbuffer = FIND(renderBufferID, GrRenderBufferObj , 385 GrRenderBufferObj *renderbuffer = FIND(renderBufferID, GrRenderBufferObj ,
394 kRenderBuffer_ObjTypes); 386 kRenderBuffer_ObjTypes);
395 387
396 switch (attachment) { 388 switch (attachment) {
397 case GR_GL_COLOR_ATTACHMENT0: 389 case GR_GL_COLOR_ATTACHMENT0:
398 framebuffer->setColor(renderbuffer); 390 framebuffer->setColor(renderbuffer);
399 break; 391 break;
400 case GR_GL_DEPTH_ATTACHMENT:
401 framebuffer->setDepth(renderbuffer);
402 break;
403 case GR_GL_STENCIL_ATTACHMENT: 392 case GR_GL_STENCIL_ATTACHMENT:
404 framebuffer->setStencil(renderbuffer); 393 framebuffer->setStencil(renderbuffer);
405 break; 394 break;
406 default: 395 default:
407 GrAlwaysAssert(false); 396 GrAlwaysAssert(false);
408 break; 397 break;
409 }; 398 };
410 399
411 } 400 }
412 401
(...skipping 18 matching lines...) Expand all
431 // could lead to a feedback loop 420 // could lead to a feedback loop
432 GrAlwaysAssert(!texture->getBound()); 421 GrAlwaysAssert(!texture->getBound());
433 } 422 }
434 423
435 GrAlwaysAssert(0 == level); 424 GrAlwaysAssert(0 == level);
436 425
437 switch (attachment) { 426 switch (attachment) {
438 case GR_GL_COLOR_ATTACHMENT0: 427 case GR_GL_COLOR_ATTACHMENT0:
439 framebuffer->setColor(texture); 428 framebuffer->setColor(texture);
440 break; 429 break;
441 case GR_GL_DEPTH_ATTACHMENT:
442 framebuffer->setDepth(texture);
443 break;
444 case GR_GL_STENCIL_ATTACHMENT: 430 case GR_GL_STENCIL_ATTACHMENT:
445 framebuffer->setStencil(texture); 431 framebuffer->setStencil(texture);
446 break; 432 break;
447 default: 433 default:
448 GrAlwaysAssert(false); 434 GrAlwaysAssert(false);
449 break; 435 break;
450 }; 436 };
451 } 437 }
452 438
453 GrGLuint createProgram() override { 439 GrGLuint createProgram() override {
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 namespace sk_gpu_test { 1121 namespace sk_gpu_test {
1136 GLTestContext* CreateDebugGLTestContext() { 1122 GLTestContext* CreateDebugGLTestContext() {
1137 GLTestContext* ctx = new DebugGLContext(); 1123 GLTestContext* ctx = new DebugGLContext();
1138 if (ctx->isValid()) { 1124 if (ctx->isValid()) {
1139 return ctx; 1125 return ctx;
1140 } 1126 }
1141 delete ctx; 1127 delete ctx;
1142 return nullptr; 1128 return nullptr;
1143 } 1129 }
1144 } 1130 }
OLDNEW
« no previous file with comments | « no previous file | tools/gpu/gl/debug/GrFrameBufferObj.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698