| 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 "modules/webgl/WebGL2RenderingContextBase.h" | 6 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 7 | 7 |
| 8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 RefPtr<Image> image = videoFrameToImage(video); | 586 RefPtr<Image> image = videoFrameToImage(video); |
| 587 if (!image) | 587 if (!image) |
| 588 return; | 588 return; |
| 589 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im
age.get(), WebGLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultipl
yAlpha); | 589 texSubImage3DImpl(target, level, xoffset, yoffset, zoffset, format, type, im
age.get(), WebGLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultipl
yAlpha); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, GLint level, G
Lint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLs
izei height) | 592 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, GLint level, G
Lint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLs
izei height) |
| 593 { | 593 { |
| 594 if (isContextLost()) | 594 if (isContextLost()) |
| 595 return; | 595 return; |
| 596 | 596 if (!validateCopyTexSubImage("copyTexSubImage3D", target, level, xoffset, yo
ffset, zoffset, x, y, width, height)) |
| 597 notImplemented(); | 597 return; |
| 598 WebGLFramebuffer* readFramebufferBinding = nullptr; |
| 599 if (!validateReadBufferAndGetInfo("copyTexSubImage3D", readFramebufferBindin
g, nullptr, nullptr)) |
| 600 return; |
| 601 clearIfComposited(); |
| 602 ScopedDrawingBufferBinder binder(drawingBuffer(), readFramebufferBinding); |
| 603 webContext()->copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x,
y, width, height); |
| 598 } | 604 } |
| 599 | 605 |
| 600 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, GLint level
, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint bor
der, DOMArrayBufferView* data) | 606 void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, GLint level
, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint bor
der, DOMArrayBufferView* data) |
| 601 { | 607 { |
| 602 if (isContextLost()) | 608 if (isContextLost()) |
| 603 return; | 609 return; |
| 604 | 610 |
| 605 WebGLTexture* tex = validateTextureBinding("compressedTexImage3D", target, t
rue); | 611 WebGLTexture* tex = validateTextureBinding("compressedTexImage3D", target, t
rue); |
| 606 if (!tex) | 612 if (!tex) |
| 607 return; | 613 return; |
| (...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2471 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 2477 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
| 2472 { | 2478 { |
| 2473 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 2479 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
| 2474 return m_readFramebufferBinding->colorBufferFormat(); | 2480 return m_readFramebufferBinding->colorBufferFormat(); |
| 2475 if (m_requestedAttributes.alpha()) | 2481 if (m_requestedAttributes.alpha()) |
| 2476 return GL_RGBA; | 2482 return GL_RGBA; |
| 2477 return GL_RGB; | 2483 return GL_RGB; |
| 2478 } | 2484 } |
| 2479 | 2485 |
| 2480 } // namespace blink | 2486 } // namespace blink |
| OLD | NEW |