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

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

Issue 2959893002: FramebufferRenderbuffer() generates INVALID_OP if renderbuffer has never been bound. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc ('k') | 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 (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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 GLenum renderbuffertarget, 2512 GLenum renderbuffertarget,
2513 WebGLRenderbuffer* buffer) { 2513 WebGLRenderbuffer* buffer) {
2514 if (isContextLost() || !ValidateFramebufferFuncParameters( 2514 if (isContextLost() || !ValidateFramebufferFuncParameters(
2515 "framebufferRenderbuffer", target, attachment)) 2515 "framebufferRenderbuffer", target, attachment))
2516 return; 2516 return;
2517 if (renderbuffertarget != GL_RENDERBUFFER) { 2517 if (renderbuffertarget != GL_RENDERBUFFER) {
2518 SynthesizeGLError(GL_INVALID_ENUM, "framebufferRenderbuffer", 2518 SynthesizeGLError(GL_INVALID_ENUM, "framebufferRenderbuffer",
2519 "invalid target"); 2519 "invalid target");
2520 return; 2520 return;
2521 } 2521 }
2522 if (buffer && !buffer->Validate(ContextGroup(), this)) { 2522 if (buffer && (!buffer->HasEverBeenBound() ||
2523 !buffer->Validate(ContextGroup(), this))) {
2523 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", 2524 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer",
2524 "no buffer or buffer not from this context"); 2525 "buffer never bound or buffer not from this context");
2525 return; 2526 return;
2526 } 2527 }
2527 // Don't allow the default framebuffer to be mutated; all current 2528 // Don't allow the default framebuffer to be mutated; all current
2528 // implementations use an FBO internally in place of the default 2529 // implementations use an FBO internally in place of the default
2529 // FBO. 2530 // FBO.
2530 WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target); 2531 WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target);
2531 if (!framebuffer_binding || !framebuffer_binding->Object()) { 2532 if (!framebuffer_binding || !framebuffer_binding->Object()) {
2532 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer", 2533 SynthesizeGLError(GL_INVALID_OPERATION, "framebufferRenderbuffer",
2533 "no framebuffer bound"); 2534 "no framebuffer bound");
2534 return; 2535 return;
(...skipping 5248 matching lines...) Expand 10 before | Expand all | Expand 10 after
7783 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7784 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7784 HTMLCanvasElementOrOffscreenCanvas& result) const { 7785 HTMLCanvasElementOrOffscreenCanvas& result) const {
7785 if (canvas()) { 7786 if (canvas()) {
7786 result.setHTMLCanvasElement(static_cast<HTMLCanvasElement*>(host())); 7787 result.setHTMLCanvasElement(static_cast<HTMLCanvasElement*>(host()));
7787 } else { 7788 } else {
7788 result.setOffscreenCanvas(static_cast<OffscreenCanvas*>(host())); 7789 result.setOffscreenCanvas(static_cast<OffscreenCanvas*>(host()));
7789 } 7790 }
7790 } 7791 }
7791 7792
7792 } // namespace blink 7793 } // namespace blink
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698