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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // WebExternalTextureLayerClient implementation. | 169 // WebExternalTextureLayerClient implementation. |
170 bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override
; | 170 bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override
; |
171 void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = f
alse) override; | 171 void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource = f
alse) override; |
172 | 172 |
173 // Destroys the TEXTURE_2D binding for the owned context | 173 // Destroys the TEXTURE_2D binding for the owned context |
174 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture,
GLenum internalFormat, | 174 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture,
GLenum internalFormat, |
175 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD
rawingBuffer); | 175 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD
rawingBuffer); |
176 | 176 |
177 void setPackAlignment(GLint param); | 177 void setPackAlignment(GLint param); |
178 | 178 |
179 void paintRenderingResultsToCanvas(ImageBuffer*); | |
180 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF::
ArrayBufferContents&); | 179 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF::
ArrayBufferContents&); |
181 | 180 |
182 int sampleCount() const { return m_sampleCount; } | 181 int sampleCount() const { return m_sampleCount; } |
183 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode ==
MSAAExplicitResolve; } | 182 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode ==
MSAAExplicitResolve; } |
184 | 183 |
185 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. | 184 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. |
186 // Otherwise, bind to the default FBO. | 185 // Otherwise, bind to the default FBO. |
187 void restoreFramebufferBindings(); | 186 void restoreFramebufferBindings(); |
188 | 187 |
189 protected: // For unittests | 188 protected: // For unittests |
(...skipping 21 matching lines...) Expand all Loading... |
211 void clearPlatformLayer(); | 210 void clearPlatformLayer(); |
212 | 211 |
213 PassRefPtr<MailboxInfo> recycledMailbox(); | 212 PassRefPtr<MailboxInfo> recycledMailbox(); |
214 PassRefPtr<MailboxInfo> createNewMailbox(const TextureInfo&); | 213 PassRefPtr<MailboxInfo> createNewMailbox(const TextureInfo&); |
215 void deleteMailbox(const WebExternalTextureMailbox&); | 214 void deleteMailbox(const WebExternalTextureMailbox&); |
216 void freeRecycledMailboxes(); | 215 void freeRecycledMailboxes(); |
217 | 216 |
218 // Updates the current size of the buffer, ensuring that s_currentResourceUs
ePixels is updated. | 217 // Updates the current size of the buffer, ensuring that s_currentResourceUs
ePixels is updated. |
219 void setSize(const IntSize& size); | 218 void setSize(const IntSize& size); |
220 | 219 |
221 void paintFramebufferToCanvas(int framebuffer, int width, int height, bool p
remultiplyAlpha, ImageBuffer*); | |
222 | |
223 // This is the order of bytes to use when doing a readback. | 220 // This is the order of bytes to use when doing a readback. |
224 enum ReadbackOrder { | 221 enum ReadbackOrder { |
225 ReadbackRGBA, | 222 ReadbackRGBA, |
226 ReadbackSkia | 223 ReadbackSkia |
227 }; | 224 }; |
228 | 225 |
229 // Helper function which does a readback from the currently-bound | 226 // Helper function which does a readback from the currently-bound |
230 // framebuffer into a buffer of a certain size with 4-byte pixels. | 227 // framebuffer into a buffer of a certain size with 4-byte pixels. |
231 void readBackFramebuffer(unsigned char* pixels, int width, int height, Readb
ackOrder, WebGLImageConversion::AlphaOp); | 228 void readBackFramebuffer(unsigned char* pixels, int width, int height, Readb
ackOrder, WebGLImageConversion::AlphaOp); |
232 | 229 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // used to resize the Canvas. | 312 // used to resize the Canvas. |
316 SkBitmap m_resizingBitmap; | 313 SkBitmap m_resizingBitmap; |
317 | 314 |
318 // Used to flip a bitmap vertically. | 315 // Used to flip a bitmap vertically. |
319 Vector<uint8_t> m_scanline; | 316 Vector<uint8_t> m_scanline; |
320 }; | 317 }; |
321 | 318 |
322 } // namespace blink | 319 } // namespace blink |
323 | 320 |
324 #endif // DrawingBuffer_h | 321 #endif // DrawingBuffer_h |
OLD | NEW |