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

Side by Side Diff: Source/core/html/canvas/WebGLFramebuffer.cpp

Issue 1205573003: WebGL 2: validate read buffer attachment when reading from FBO (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed zmo@'s feedback: readbuffer is per framebuffer, not per rendering context Created 5 years, 5 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 PassRefPtrWillBeRawPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRendering ContextBase* ctx) 273 PassRefPtrWillBeRawPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRendering ContextBase* ctx)
274 { 274 {
275 return adoptRefWillBeNoop(new WebGLFramebuffer(ctx)); 275 return adoptRefWillBeNoop(new WebGLFramebuffer(ctx));
276 } 276 }
277 277
278 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx) 278 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx)
279 : WebGLContextObject(ctx) 279 : WebGLContextObject(ctx)
280 , m_object(ctx->webContext()->createFramebuffer()) 280 , m_object(ctx->webContext()->createFramebuffer())
281 , m_hasEverBeenBound(false) 281 , m_hasEverBeenBound(false)
282 , m_readBuffer(GL_COLOR_ATTACHMENT0)
282 { 283 {
283 } 284 }
284 285
285 WebGLFramebuffer::~WebGLFramebuffer() 286 WebGLFramebuffer::~WebGLFramebuffer()
286 { 287 {
287 // Delete the platform framebuffer resource. Explicit detachment 288 // Delete the platform framebuffer resource. Explicit detachment
288 // is for the benefit of Oilpan, where the framebuffer object 289 // is for the benefit of Oilpan, where the framebuffer object
289 // isn't detached when it and the WebGLRenderingContextBase object 290 // isn't detached when it and the WebGLRenderingContextBase object
290 // it is registered with are both finalized. Without Oilpan, the 291 // it is registered with are both finalized. Without Oilpan, the
291 // object will have been detached. 292 // object will have been detached.
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 633
633 DEFINE_TRACE(WebGLFramebuffer) 634 DEFINE_TRACE(WebGLFramebuffer)
634 { 635 {
635 #if ENABLE(OILPAN) 636 #if ENABLE(OILPAN)
636 visitor->trace(m_attachments); 637 visitor->trace(m_attachments);
637 #endif 638 #endif
638 WebGLContextObject::trace(visitor); 639 WebGLContextObject::trace(visitor);
639 } 640 }
640 641
641 } 642 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698