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

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 Created 5 years, 7 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 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 // FIXME: Some of these ES3 buffer targets may require additional state tracking. 1519 // FIXME: Some of these ES3 buffer targets may require additional state tracking.
1520 break; 1520 break;
1521 default: 1521 default:
1522 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target"); 1522 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target");
1523 return false; 1523 return false;
1524 } 1524 }
1525 1525
1526 return true; 1526 return true;
1527 } 1527 }
1528 1528
1529 bool WebGL2RenderingContextBase::validateFramebufferTarget(GLenum target)
1530 {
1531 switch (target) {
1532 case GL_FRAMEBUFFER:
1533 case GL_READ_FRAMEBUFFER:
1534 case GL_DRAW_FRAMEBUFFER:
1535 return true;
1536 default:
1537 return false;
1538 }
1539 }
1540
1541 WebGLFramebuffer* WebGL2RenderingContextBase::getFramebufferBinding(GLenum targe t)
1542 {
1543 if (target == GL_READ_FRAMEBUFFER)
1544 return m_readFramebufferBinding.get();
1545 return m_framebufferBinding.get();
1546 }
1547
1529 DEFINE_TRACE(WebGL2RenderingContextBase) 1548 DEFINE_TRACE(WebGL2RenderingContextBase)
1530 { 1549 {
1531 visitor->trace(m_readFramebufferBinding); 1550 visitor->trace(m_readFramebufferBinding);
1532 WebGLRenderingContextBase::trace(visitor); 1551 WebGLRenderingContextBase::trace(visitor);
1533 } 1552 }
1534 1553
1535 WebGLTexture* WebGL2RenderingContextBase::validateTextureBinding(const char* fun ctionName, GLenum target, bool useSixEnumsForCubeMap) 1554 WebGLTexture* WebGL2RenderingContextBase::validateTextureBinding(const char* fun ctionName, GLenum target, bool useSixEnumsForCubeMap)
1536 { 1555 {
1537 switch (target) { 1556 switch (target) {
1538 // FIXME: add 2D Array texture binding point and 3D texture binding point. 1557 // FIXME: add 2D Array texture binding point and 3D texture binding point.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 GLfloat value = 0.f; 1598 GLfloat value = 0.f;
1580 webContext()->getTexParameterfv(target, pname, &value); 1599 webContext()->getTexParameterfv(target, pname, &value);
1581 return WebGLAny(scriptState, value); 1600 return WebGLAny(scriptState, value);
1582 } 1601 }
1583 default: 1602 default:
1584 return WebGLRenderingContextBase::getTexParameter(scriptState, target, p name); 1603 return WebGLRenderingContextBase::getTexParameter(scriptState, target, p name);
1585 } 1604 }
1586 } 1605 }
1587 1606
1588 } // namespace blink 1607 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGL2RenderingContextBase.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698