| OLD | NEW |
| 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 Loading... |
| 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 |
| 1476 RefPtrWillBeMember<WebGLFramebuffer> WebGL2RenderingContextBase::getFramebufferB
inding(GLenum target) |
| 1477 { |
| 1478 if (target == GL_READ_FRAMEBUFFER) |
| 1479 return m_readFramebufferBinding; |
| 1480 return m_framebufferBinding; |
| 1481 } |
| 1482 |
| 1464 DEFINE_TRACE(WebGL2RenderingContextBase) | 1483 DEFINE_TRACE(WebGL2RenderingContextBase) |
| 1465 { | 1484 { |
| 1466 visitor->trace(m_readFramebufferBinding); | 1485 visitor->trace(m_readFramebufferBinding); |
| 1467 WebGLRenderingContextBase::trace(visitor); | 1486 WebGLRenderingContextBase::trace(visitor); |
| 1468 } | 1487 } |
| 1469 | 1488 |
| 1470 WebGLTexture* WebGL2RenderingContextBase::validateTextureBinding(const char* fun
ctionName, GLenum target, bool useSixEnumsForCubeMap) | 1489 WebGLTexture* WebGL2RenderingContextBase::validateTextureBinding(const char* fun
ctionName, GLenum target, bool useSixEnumsForCubeMap) |
| 1471 { | 1490 { |
| 1472 switch (target) { | 1491 switch (target) { |
| 1473 // FIXME: add 2D Array texture binding point and 3D texture binding point. | 1492 // FIXME: add 2D Array texture binding point and 3D texture binding point. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 GLfloat value = 0.f; | 1535 GLfloat value = 0.f; |
| 1517 webContext()->getTexParameterfv(target, pname, &value); | 1536 webContext()->getTexParameterfv(target, pname, &value); |
| 1518 return WebGLAny(scriptState, value); | 1537 return WebGLAny(scriptState, value); |
| 1519 } | 1538 } |
| 1520 default: | 1539 default: |
| 1521 return WebGLRenderingContextBase::getTexParameter(scriptState, target, p
name); | 1540 return WebGLRenderingContextBase::getTexParameter(scriptState, target, p
name); |
| 1522 } | 1541 } |
| 1523 } | 1542 } |
| 1524 | 1543 |
| 1525 } // namespace blink | 1544 } // namespace blink |
| OLD | NEW |