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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 } | 1090 } |
1091 return true; | 1091 return true; |
1092 } | 1092 } |
1093 | 1093 |
1094 // Copy from the source directly to the texture via the gpu, without a | 1094 // Copy from the source directly to the texture via the gpu, without a |
1095 // read-back to system memory. Source could be canvas or imageBitmap. | 1095 // read-back to system memory. Source could be canvas or imageBitmap. |
1096 void texImageByGPU(TexImageFunctionID, | 1096 void texImageByGPU(TexImageFunctionID, |
1097 WebGLTexture*, | 1097 WebGLTexture*, |
1098 GLenum target, | 1098 GLenum target, |
1099 GLint level, | 1099 GLint level, |
1100 GLint internalformat, | |
1101 GLenum type, | |
1102 GLint xoffset, | 1100 GLint xoffset, |
1103 GLint yoffset, | 1101 GLint yoffset, |
1104 GLint zoffset, | 1102 GLint zoffset, |
1105 CanvasImageSource*, | 1103 CanvasImageSource*, |
1106 const IntRect& sourceSubRectangle); | 1104 const IntRect& sourceSubRectangle); |
1107 virtual bool canUseTexImageByGPU(TexImageFunctionID, | 1105 virtual bool canUseTexImageByGPU(TexImageFunctionID, |
1108 GLint internalformat, | 1106 GLint internalformat, |
1109 GLenum type); | 1107 GLenum type); |
1110 | 1108 |
1111 virtual WebGLImageConversion::PixelStoreParams getPackPixelStoreParams(); | 1109 virtual WebGLImageConversion::PixelStoreParams getPackPixelStoreParams(); |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 const CanvasContextCreationAttributes&, | 1632 const CanvasContextCreationAttributes&, |
1635 unsigned); | 1633 unsigned); |
1636 static bool supportOwnOffscreenSurface(ExecutionContext*); | 1634 static bool supportOwnOffscreenSurface(ExecutionContext*); |
1637 static std::unique_ptr<WebGraphicsContext3DProvider> | 1635 static std::unique_ptr<WebGraphicsContext3DProvider> |
1638 createContextProviderInternal(HTMLCanvasElement*, | 1636 createContextProviderInternal(HTMLCanvasElement*, |
1639 ScriptState*, | 1637 ScriptState*, |
1640 const CanvasContextCreationAttributes&, | 1638 const CanvasContextCreationAttributes&, |
1641 unsigned); | 1639 unsigned); |
1642 void texImageCanvasByGPU(TexImageFunctionID, | 1640 void texImageCanvasByGPU(TexImageFunctionID, |
1643 HTMLCanvasElement*, | 1641 HTMLCanvasElement*, |
| 1642 GLenum, |
1644 GLuint, | 1643 GLuint, |
1645 GLenum, | |
1646 GLenum, | |
1647 GLint, | 1644 GLint, |
1648 GLint, | 1645 GLint, |
| 1646 const IntRect&); |
| 1647 void texImageBitmapByGPU(ImageBitmap*, |
| 1648 GLenum, |
| 1649 GLuint, |
| 1650 bool, |
1649 GLint, | 1651 GLint, |
1650 const IntRect& sourceSubRectangle); | 1652 GLint, |
1651 void texImageBitmapByGPU(ImageBitmap*, GLuint, GLenum, GLenum, GLint, bool); | 1653 const IntRect&); |
1652 | 1654 |
1653 sk_sp<SkImage> makeImageSnapshot(SkImageInfo&); | 1655 sk_sp<SkImage> makeImageSnapshot(SkImageInfo&); |
1654 const unsigned m_version; | 1656 const unsigned m_version; |
1655 | 1657 |
1656 bool isPaintable() const final { return drawingBuffer(); } | 1658 bool isPaintable() const final { return drawingBuffer(); } |
1657 }; | 1659 }; |
1658 | 1660 |
1659 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, | 1661 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, |
1660 CanvasRenderingContext, | 1662 CanvasRenderingContext, |
1661 context, | 1663 context, |
1662 context->is3d(), | 1664 context->is3d(), |
1663 context.is3d()); | 1665 context.is3d()); |
1664 | 1666 |
1665 } // namespace blink | 1667 } // namespace blink |
1666 | 1668 |
1667 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1669 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
1668 blink::WebGLRenderingContextBase::TextureUnitState); | 1670 blink::WebGLRenderingContextBase::TextureUnitState); |
1669 | 1671 |
1670 #endif // WebGLRenderingContextBase_h | 1672 #endif // WebGLRenderingContextBase_h |
OLD | NEW |