| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fb
o; } | 129 void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fb
o; } |
| 130 | 130 |
| 131 // Track the currently active texture unit. Texture unit 0 is used as host f
or a scratch | 131 // Track the currently active texture unit. Texture unit 0 is used as host f
or a scratch |
| 132 // texture. | 132 // texture. |
| 133 void setActiveTextureUnit(GLint textureUnit) { m_activeTextureUnit = texture
Unit; } | 133 void setActiveTextureUnit(GLint textureUnit) { m_activeTextureUnit = texture
Unit; } |
| 134 | 134 |
| 135 bool multisample() const; | 135 bool multisample() const; |
| 136 | 136 |
| 137 Platform3DObject framebuffer() const; | 137 Platform3DObject framebuffer() const; |
| 138 | 138 |
| 139 bool discardFramebufferSupported() const { return m_discardFramebufferSuppor
ted; } |
| 140 |
| 139 void markContentsChanged(); | 141 void markContentsChanged(); |
| 140 void markLayerComposited(); | 142 void markLayerComposited(); |
| 141 bool layerComposited() const; | 143 bool layerComposited() const; |
| 142 void setIsHidden(bool); | 144 void setIsHidden(bool); |
| 143 | 145 |
| 144 WebLayer* platformLayer(); | 146 WebLayer* platformLayer(); |
| 145 void paintCompositedResultsToCanvas(ImageBuffer*); | 147 void paintCompositedResultsToCanvas(ImageBuffer*); |
| 146 | 148 |
| 147 WebGraphicsContext3D* context(); | 149 WebGraphicsContext3D* context(); |
| 148 | 150 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 162 | 164 |
| 163 void paintRenderingResultsToCanvas(ImageBuffer*); | 165 void paintRenderingResultsToCanvas(ImageBuffer*); |
| 164 PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&); | 166 PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&); |
| 165 | 167 |
| 166 protected: // For unittests | 168 protected: // For unittests |
| 167 DrawingBuffer( | 169 DrawingBuffer( |
| 168 PassOwnPtr<WebGraphicsContext3D>, | 170 PassOwnPtr<WebGraphicsContext3D>, |
| 169 PassOwnPtr<Extensions3DUtil>, | 171 PassOwnPtr<Extensions3DUtil>, |
| 170 bool multisampleExtensionSupported, | 172 bool multisampleExtensionSupported, |
| 171 bool packedDepthStencilExtensionSupported, | 173 bool packedDepthStencilExtensionSupported, |
| 174 bool discardFramebufferSupported, |
| 172 PreserveDrawingBuffer, | 175 PreserveDrawingBuffer, |
| 173 WebGraphicsContext3D::Attributes requestedAttributes, | 176 WebGraphicsContext3D::Attributes requestedAttributes, |
| 174 PassRefPtr<ContextEvictionManager>); | 177 PassRefPtr<ContextEvictionManager>); |
| 175 | 178 |
| 176 bool initialize(const IntSize&); | 179 bool initialize(const IntSize&); |
| 177 | 180 |
| 178 private: | 181 private: |
| 179 void mailboxReleasedWithoutRecycling(const WebExternalTextureMailbox&); | 182 void mailboxReleasedWithoutRecycling(const WebExternalTextureMailbox&); |
| 180 | 183 |
| 181 unsigned createColorTexture(); | 184 unsigned createColorTexture(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 Platform3DObject m_texture2DBinding; | 235 Platform3DObject m_texture2DBinding; |
| 233 Platform3DObject m_framebufferBinding; | 236 Platform3DObject m_framebufferBinding; |
| 234 GLenum m_activeTextureUnit; | 237 GLenum m_activeTextureUnit; |
| 235 | 238 |
| 236 OwnPtr<WebGraphicsContext3D> m_context; | 239 OwnPtr<WebGraphicsContext3D> m_context; |
| 237 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 240 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
| 238 IntSize m_size; | 241 IntSize m_size; |
| 239 WebGraphicsContext3D::Attributes m_requestedAttributes; | 242 WebGraphicsContext3D::Attributes m_requestedAttributes; |
| 240 bool m_multisampleExtensionSupported; | 243 bool m_multisampleExtensionSupported; |
| 241 bool m_packedDepthStencilExtensionSupported; | 244 bool m_packedDepthStencilExtensionSupported; |
| 245 bool m_discardFramebufferSupported; |
| 242 Platform3DObject m_fbo; | 246 Platform3DObject m_fbo; |
| 243 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. | 247 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. |
| 244 TextureInfo m_colorBuffer; | 248 TextureInfo m_colorBuffer; |
| 245 TextureInfo m_frontColorBuffer; | 249 TextureInfo m_frontColorBuffer; |
| 246 | 250 |
| 247 // This is used when we have OES_packed_depth_stencil. | 251 // This is used when we have OES_packed_depth_stencil. |
| 248 Platform3DObject m_depthStencilBuffer; | 252 Platform3DObject m_depthStencilBuffer; |
| 249 | 253 |
| 250 // These are used when we don't. | 254 // These are used when we don't. |
| 251 Platform3DObject m_depthBuffer; | 255 Platform3DObject m_depthBuffer; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // used to resize the Canvas. | 300 // used to resize the Canvas. |
| 297 SkBitmap m_resizingBitmap; | 301 SkBitmap m_resizingBitmap; |
| 298 | 302 |
| 299 // Used to flip a bitmap vertically. | 303 // Used to flip a bitmap vertically. |
| 300 Vector<uint8_t> m_scanline; | 304 Vector<uint8_t> m_scanline; |
| 301 }; | 305 }; |
| 302 | 306 |
| 303 } // namespace blink | 307 } // namespace blink |
| 304 | 308 |
| 305 #endif // DrawingBuffer_h | 309 #endif // DrawingBuffer_h |
| OLD | NEW |