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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp

Issue 2401893002: [wrapper-tracing] WebGL and friends: Add write barriers (Closed)
Patch Set: Rebase Created 4 years, 2 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 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 void WebGLFramebuffer::setAttachmentInternal(GLenum target, 432 void WebGLFramebuffer::setAttachmentInternal(GLenum target,
433 GLenum attachment, 433 GLenum attachment,
434 GLenum texTarget, 434 GLenum texTarget,
435 WebGLTexture* texture, 435 WebGLTexture* texture,
436 GLint level, 436 GLint level,
437 GLint layer) { 437 GLint layer) {
438 DCHECK(isBound(target)); 438 DCHECK(isBound(target));
439 DCHECK(m_object); 439 DCHECK(m_object);
440 removeAttachmentInternal(target, attachment); 440 removeAttachmentInternal(target, attachment);
441 if (texture && texture->object()) { 441 if (texture && texture->object()) {
442 m_attachments.add(attachment, WebGLTextureAttachment::create( 442 m_attachments.add(
443 texture, texTarget, level, layer)); 443 attachment, TraceWrapperMember<WebGLAttachment>(
444 this, WebGLTextureAttachment::create(texture, texTarget,
445 level, layer)));
444 drawBuffersIfNecessary(false); 446 drawBuffersIfNecessary(false);
445 texture->onAttached(); 447 texture->onAttached();
446 } 448 }
447 } 449 }
448 450
449 void WebGLFramebuffer::setAttachmentInternal(GLenum target, 451 void WebGLFramebuffer::setAttachmentInternal(GLenum target,
450 GLenum attachment, 452 GLenum attachment,
451 WebGLRenderbuffer* renderbuffer) { 453 WebGLRenderbuffer* renderbuffer) {
452 DCHECK(isBound(target)); 454 DCHECK(isBound(target));
453 DCHECK(m_object); 455 DCHECK(m_object);
454 removeAttachmentInternal(target, attachment); 456 removeAttachmentInternal(target, attachment);
455 if (renderbuffer && renderbuffer->object()) { 457 if (renderbuffer && renderbuffer->object()) {
456 m_attachments.add(attachment, 458 m_attachments.add(
457 WebGLRenderbufferAttachment::create(renderbuffer)); 459 attachment,
460 TraceWrapperMember<WebGLAttachment>(
461 this, WebGLRenderbufferAttachment::create(renderbuffer)));
458 drawBuffersIfNecessary(false); 462 drawBuffersIfNecessary(false);
459 renderbuffer->onAttached(); 463 renderbuffer->onAttached();
460 } 464 }
461 } 465 }
462 466
463 void WebGLFramebuffer::removeAttachmentInternal(GLenum target, 467 void WebGLFramebuffer::removeAttachmentInternal(GLenum target,
464 GLenum attachment) { 468 GLenum attachment) {
465 DCHECK(isBound(target)); 469 DCHECK(isBound(target));
466 DCHECK(m_object); 470 DCHECK(m_object);
467 471
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 550 }
547 551
548 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) { 552 DEFINE_TRACE_WRAPPERS(WebGLFramebuffer) {
549 for (const auto& attachment : m_attachments) { 553 for (const auto& attachment : m_attachments) {
550 visitor->traceWrappers(attachment.value->object()); 554 visitor->traceWrappers(attachment.value->object());
551 } 555 }
552 WebGLContextObject::traceWrappers(visitor); 556 WebGLContextObject::traceWrappers(visitor);
553 } 557 }
554 558
555 } // namespace blink 559 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h ('k') | third_party/WebKit/Source/modules/webgl/WebGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698