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 "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
6 | 6 |
7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 break; | 454 break; |
455 default: | 455 default: |
456 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid attach
ment"); | 456 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid attach
ment"); |
457 return false; | 457 return false; |
458 } | 458 } |
459 } | 459 } |
460 } | 460 } |
461 return true; | 461 return true; |
462 } | 462 } |
463 | 463 |
| 464 bool WebGL2RenderingContextBase::canUseTexImageCanvasByGPU(GLint internalformat,
GLenum type) |
| 465 { |
| 466 switch (internalformat) { |
| 467 case GL_RGB565: |
| 468 case GL_RGBA4: |
| 469 case GL_RGB5_A1: |
| 470 // FIXME: ES3 limitation that CopyTexImage with sized internalformat, |
| 471 // component sizes have to match the source color format. |
| 472 return false; |
| 473 default: |
| 474 break; |
| 475 } |
| 476 return WebGLRenderingContextBase::canUseTexImageCanvasByGPU(internalformat,
type); |
| 477 } |
| 478 |
464 void WebGL2RenderingContextBase::invalidateFramebuffer(GLenum target, const Vect
or<GLenum>& attachments) | 479 void WebGL2RenderingContextBase::invalidateFramebuffer(GLenum target, const Vect
or<GLenum>& attachments) |
465 { | 480 { |
466 if (isContextLost()) | 481 if (isContextLost()) |
467 return; | 482 return; |
468 | 483 |
469 Vector<GLenum> translatedAttachments = attachments; | 484 Vector<GLenum> translatedAttachments = attachments; |
470 if (!checkAndTranslateAttachments("invalidateFramebuffer", target, translate
dAttachments)) | 485 if (!checkAndTranslateAttachments("invalidateFramebuffer", target, translate
dAttachments)) |
471 return; | 486 return; |
472 contextGL()->InvalidateFramebuffer(target, translatedAttachments.size(), tra
nslatedAttachments.data()); | 487 contextGL()->InvalidateFramebuffer(target, translatedAttachments.size(), tra
nslatedAttachments.data()); |
473 } | 488 } |
(...skipping 3129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3603 params.skipPixels = m_unpackSkipPixels; | 3618 params.skipPixels = m_unpackSkipPixels; |
3604 params.skipRows = m_unpackSkipRows; | 3619 params.skipRows = m_unpackSkipRows; |
3605 if (dimension == Tex3D) { | 3620 if (dimension == Tex3D) { |
3606 params.imageHeight = m_unpackImageHeight; | 3621 params.imageHeight = m_unpackImageHeight; |
3607 params.skipImages = m_unpackSkipImages; | 3622 params.skipImages = m_unpackSkipImages; |
3608 } | 3623 } |
3609 return params; | 3624 return params; |
3610 } | 3625 } |
3611 | 3626 |
3612 } // namespace blink | 3627 } // namespace blink |
OLD | NEW |