| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool initialize(const IntSize&); | 178 bool initialize(const IntSize&); |
| 179 | 179 |
| 180 private: | 180 private: |
| 181 void mailboxReleasedWithoutRecycling(const WebExternalTextureMailbox&); | 181 void mailboxReleasedWithoutRecycling(const WebExternalTextureMailbox&); |
| 182 | 182 |
| 183 unsigned createColorTexture(); | 183 unsigned createColorTexture(); |
| 184 // Create the depth/stencil and multisample buffers, if needed. | 184 // Create the depth/stencil and multisample buffers, if needed. |
| 185 void createSecondaryBuffers(); | 185 void createSecondaryBuffers(); |
| 186 bool resizeFramebuffer(const IntSize&); | 186 bool resizeFramebuffer(const IntSize&); |
| 187 bool resizeMultisampleFramebuffer(const IntSize&); | 187 bool resizeMultisampleFramebuffer(const IntSize&); |
| 188 void resizeDepthStencil(const IntSize&); | 188 bool resizeDepthStencil(const IntSize&); |
| 189 | 189 |
| 190 // Bind to the m_framebufferBinding if it's not 0. Otherwise, bind to the de
fault FBO. | 190 // Bind to the m_framebufferBinding if it's not 0. Otherwise, bind to the de
fault FBO. |
| 191 void restoreFramebufferBinding(); | 191 void restoreFramebufferBinding(); |
| 192 | 192 |
| 193 void clearPlatformLayer(); | 193 void clearPlatformLayer(); |
| 194 | 194 |
| 195 PassRefPtr<MailboxInfo> recycledMailbox(); | 195 PassRefPtr<MailboxInfo> recycledMailbox(); |
| 196 PassRefPtr<MailboxInfo> createNewMailbox(const TextureInfo&); | 196 PassRefPtr<MailboxInfo> createNewMailbox(const TextureInfo&); |
| 197 void deleteMailbox(const WebExternalTextureMailbox&); | 197 void deleteMailbox(const WebExternalTextureMailbox&); |
| 198 void freeRecycledMailboxes(); | 198 void freeRecycledMailboxes(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 212 // framebuffer into a buffer of a certain size with 4-byte pixels. | 212 // framebuffer into a buffer of a certain size with 4-byte pixels. |
| 213 void readBackFramebuffer(unsigned char* pixels, int width, int height, Readb
ackOrder, WebGLImageConversion::AlphaOp); | 213 void readBackFramebuffer(unsigned char* pixels, int width, int height, Readb
ackOrder, WebGLImageConversion::AlphaOp); |
| 214 | 214 |
| 215 // Helper function to flip a bitmap vertically. | 215 // Helper function to flip a bitmap vertically. |
| 216 void flipVertically(uint8_t* data, int width, int height); | 216 void flipVertically(uint8_t* data, int width, int height); |
| 217 | 217 |
| 218 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. | 218 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. |
| 219 // By default, alignment is 4, the OpenGL default setting. | 219 // By default, alignment is 4, the OpenGL default setting. |
| 220 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); | 220 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); |
| 221 // Allocate buffer storage to be sent to compositor using either texImage2D
or CHROMIUM_image based on available support. | 221 // Allocate buffer storage to be sent to compositor using either texImage2D
or CHROMIUM_image based on available support. |
| 222 void allocateTextureMemory(TextureInfo*, const IntSize&); | 222 bool allocateTextureMemory(TextureInfo*, const IntSize&); |
| 223 void deleteChromiumImageForTexture(TextureInfo*); | 223 void deleteChromiumImageForTexture(TextureInfo*); |
| 224 | 224 |
| 225 PreserveDrawingBuffer m_preserveDrawingBuffer; | 225 PreserveDrawingBuffer m_preserveDrawingBuffer; |
| 226 bool m_scissorEnabled; | 226 bool m_scissorEnabled; |
| 227 Platform3DObject m_texture2DBinding; | 227 Platform3DObject m_texture2DBinding; |
| 228 Platform3DObject m_framebufferBinding; | 228 Platform3DObject m_framebufferBinding; |
| 229 GLenum m_activeTextureUnit; | 229 GLenum m_activeTextureUnit; |
| 230 | 230 |
| 231 OwnPtr<WebGraphicsContext3D> m_context; | 231 OwnPtr<WebGraphicsContext3D> m_context; |
| 232 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 232 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // used to resize the Canvas. | 295 // used to resize the Canvas. |
| 296 SkBitmap m_resizingBitmap; | 296 SkBitmap m_resizingBitmap; |
| 297 | 297 |
| 298 // Used to flip a bitmap vertically. | 298 // Used to flip a bitmap vertically. |
| 299 Vector<uint8_t> m_scanline; | 299 Vector<uint8_t> m_scanline; |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 } // namespace blink | 302 } // namespace blink |
| 303 | 303 |
| 304 #endif // DrawingBuffer_h | 304 #endif // DrawingBuffer_h |
| OLD | NEW |