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

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

Issue 1473103002: Generate correct error from WEBGL_draw_buffers extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « content/test/gpu/gpu_tests/webgl_conformance_expectations.py ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers) 66 void WebGLDrawBuffers::drawBuffersWEBGL(const Vector<GLenum>& buffers)
67 { 67 {
68 WebGLExtensionScopedContext scoped(this); 68 WebGLExtensionScopedContext scoped(this);
69 if (scoped.isLost()) 69 if (scoped.isLost())
70 return; 70 return;
71 GLsizei n = buffers.size(); 71 GLsizei n = buffers.size();
72 const GLenum* bufs = buffers.data(); 72 const GLenum* bufs = buffers.data();
73 if (!scoped.context()->m_framebufferBinding) { 73 if (!scoped.context()->m_framebufferBinding) {
74 if (n != 1) { 74 if (n != 1) {
75 scoped.context()->synthesizeGLError(GL_INVALID_VALUE, "drawBuffersWE BGL", "more than one buffer"); 75 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "drawBuffe rsWEBGL", "must provide exactly one buffer");
76 return; 76 return;
77 } 77 }
78 if (bufs[0] != GL_BACK && bufs[0] != GL_NONE) { 78 if (bufs[0] != GL_BACK && bufs[0] != GL_NONE) {
79 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "drawBuffe rsWEBGL", "BACK or NONE"); 79 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "drawBuffe rsWEBGL", "BACK or NONE");
80 return; 80 return;
81 } 81 }
82 // Because the backbuffer is simulated on all current WebKit ports, we n eed to change BACK to COLOR_ATTACHMENT0. 82 // Because the backbuffer is simulated on all current WebKit ports, we n eed to change BACK to COLOR_ATTACHMENT0.
83 GLenum value = (bufs[0] == GL_BACK) ? GL_COLOR_ATTACHMENT0 : GL_NONE; 83 GLenum value = (bufs[0] == GL_BACK) ? GL_COLOR_ATTACHMENT0 : GL_NONE;
84 scoped.context()->webContext()->drawBuffersEXT(1, &value); 84 scoped.context()->webContext()->drawBuffersEXT(1, &value);
85 scoped.context()->setBackDrawBuffer(bufs[0]); 85 scoped.context()->setBackDrawBuffer(bufs[0]);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (supportsDepth) 173 if (supportsDepth)
174 context->deleteTexture(depth); 174 context->deleteTexture(depth);
175 if (supportsDepthStencil) 175 if (supportsDepthStencil)
176 context->deleteTexture(depthStencil); 176 context->deleteTexture(depthStencil);
177 for (size_t i = 0; i < colors.size(); ++i) 177 for (size_t i = 0; i < colors.size(); ++i)
178 context->deleteTexture(colors[i]); 178 context->deleteTexture(colors[i]);
179 return ok; 179 return ok;
180 } 180 }
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/webgl_conformance_expectations.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698