OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 } | 1094 } |
1095 return true; | 1095 return true; |
1096 } | 1096 } |
1097 | 1097 |
1098 // Copy from the source directly to the texture via the gpu, without a | 1098 // Copy from the source directly to the texture via the gpu, without a |
1099 // read-back to system memory. Source could be canvas or imageBitmap. | 1099 // read-back to system memory. Source could be canvas or imageBitmap. |
1100 void texImageByGPU(TexImageFunctionID, | 1100 void texImageByGPU(TexImageFunctionID, |
1101 WebGLTexture*, | 1101 WebGLTexture*, |
1102 GLenum target, | 1102 GLenum target, |
1103 GLint level, | 1103 GLint level, |
1104 GLint internalformat, | |
1105 GLenum type, | |
1106 GLint xoffset, | 1104 GLint xoffset, |
1107 GLint yoffset, | 1105 GLint yoffset, |
1108 GLint zoffset, | 1106 GLint zoffset, |
1109 CanvasImageSource*, | 1107 CanvasImageSource*, |
1110 const IntRect& sourceSubRectangle); | 1108 const IntRect& sourceSubRectangle); |
1111 virtual bool canUseTexImageByGPU(TexImageFunctionID, | 1109 virtual bool canUseTexImageByGPU(GLenum type); |
1112 GLint internalformat, | |
1113 GLenum type); | |
1114 | 1110 |
1115 virtual WebGLImageConversion::PixelStoreParams getPackPixelStoreParams(); | 1111 virtual WebGLImageConversion::PixelStoreParams getPackPixelStoreParams(); |
1116 virtual WebGLImageConversion::PixelStoreParams getUnpackPixelStoreParams( | 1112 virtual WebGLImageConversion::PixelStoreParams getUnpackPixelStoreParams( |
1117 TexImageDimension); | 1113 TexImageDimension); |
1118 | 1114 |
1119 // Helper function for copyTex{Sub}Image, check whether the internalformat | 1115 // Helper function for copyTex{Sub}Image, check whether the internalformat |
1120 // and the color buffer format of the current bound framebuffer combination | 1116 // and the color buffer format of the current bound framebuffer combination |
1121 // is valid. | 1117 // is valid. |
1122 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat, | 1118 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat, |
1123 GLenum colorBufferFormat); | 1119 GLenum colorBufferFormat); |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 const CanvasContextCreationAttributes&, | 1634 const CanvasContextCreationAttributes&, |
1639 unsigned); | 1635 unsigned); |
1640 static bool supportOwnOffscreenSurface(ExecutionContext*); | 1636 static bool supportOwnOffscreenSurface(ExecutionContext*); |
1641 static std::unique_ptr<WebGraphicsContext3DProvider> | 1637 static std::unique_ptr<WebGraphicsContext3DProvider> |
1642 createContextProviderInternal(HTMLCanvasElement*, | 1638 createContextProviderInternal(HTMLCanvasElement*, |
1643 ScriptState*, | 1639 ScriptState*, |
1644 const CanvasContextCreationAttributes&, | 1640 const CanvasContextCreationAttributes&, |
1645 unsigned); | 1641 unsigned); |
1646 void texImageCanvasByGPU(TexImageFunctionID, | 1642 void texImageCanvasByGPU(TexImageFunctionID, |
1647 HTMLCanvasElement*, | 1643 HTMLCanvasElement*, |
| 1644 GLenum, |
1648 GLuint, | 1645 GLuint, |
1649 GLenum, | |
1650 GLenum, | |
1651 GLint, | 1646 GLint, |
1652 GLint, | 1647 GLint, |
| 1648 const IntRect&); |
| 1649 void texImageBitmapByGPU(ImageBitmap*, |
| 1650 GLenum, |
| 1651 GLuint, |
| 1652 bool, |
1653 GLint, | 1653 GLint, |
1654 const IntRect& sourceSubRectangle); | 1654 GLint, |
1655 void texImageBitmapByGPU(ImageBitmap*, GLuint, GLenum, GLenum, GLint, bool); | 1655 const IntRect&); |
1656 | 1656 |
1657 sk_sp<SkImage> makeImageSnapshot(SkImageInfo&); | 1657 sk_sp<SkImage> makeImageSnapshot(SkImageInfo&); |
1658 const unsigned m_version; | 1658 const unsigned m_version; |
1659 | 1659 |
1660 bool isPaintable() const final { return drawingBuffer(); } | 1660 bool isPaintable() const final { return drawingBuffer(); } |
1661 }; | 1661 }; |
1662 | 1662 |
1663 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, | 1663 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, |
1664 CanvasRenderingContext, | 1664 CanvasRenderingContext, |
1665 context, | 1665 context, |
1666 context->is3d(), | 1666 context->is3d(), |
1667 context.is3d()); | 1667 context.is3d()); |
1668 | 1668 |
1669 } // namespace blink | 1669 } // namespace blink |
1670 | 1670 |
1671 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1671 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
1672 blink::WebGLRenderingContextBase::TextureUnitState); | 1672 blink::WebGLRenderingContextBase::TextureUnitState); |
1673 | 1673 |
1674 #endif // WebGLRenderingContextBase_h | 1674 #endif // WebGLRenderingContextBase_h |
OLD | NEW |