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

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

Issue 1099853002: WebGL: add targets for WebGL 2 when check FBO targets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed kbr@'s feedback: add a validation function to make it clear Created 5 years, 8 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/html/canvas/WebGL2RenderingContextBase.h" 6 #include "core/html/canvas/WebGL2RenderingContextBase.h"
7 7
8 #include "bindings/core/v8/WebGLAny.h" 8 #include "bindings/core/v8/WebGLAny.h"
9 #include "core/html/HTMLCanvasElement.h" 9 #include "core/html/HTMLCanvasElement.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 // FIXME: Some of these ES3 buffer targets may require additional state tracking. 1454 // FIXME: Some of these ES3 buffer targets may require additional state tracking.
1455 break; 1455 break;
1456 default: 1456 default:
1457 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); 1457 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target");
1458 return false; 1458 return false;
1459 } 1459 }
1460 1460
1461 return true; 1461 return true;
1462 } 1462 }
1463 1463
1464 bool WebGL2RenderingContextBase::validateFramebufferTarget(GLenum target)
1465 {
1466 switch (target) {
1467 case GL_FRAMEBUFFER:
1468 case GL_READ_FRAMEBUFFER:
1469 case GL_DRAW_FRAMEBUFFER:
1470 return true;
1471 default:
1472 return false;
1473 }
1474 }
1475
1464 DEFINE_TRACE(WebGL2RenderingContextBase) 1476 DEFINE_TRACE(WebGL2RenderingContextBase)
1465 { 1477 {
1466 visitor->trace(m_readFramebufferBinding); 1478 visitor->trace(m_readFramebufferBinding);
1467 WebGLRenderingContextBase::trace(visitor); 1479 WebGLRenderingContextBase::trace(visitor);
1468 } 1480 }
1469 1481
1470 } // namespace blink 1482 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698