| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 int sampleCount() const { return m_sampleCount; } | 160 int sampleCount() const { return m_sampleCount; } |
| 161 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode ==
MSAAExplicitResolve; } | 161 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode ==
MSAAExplicitResolve; } |
| 162 | 162 |
| 163 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. | 163 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. |
| 164 // Otherwise, bind to the default FBO. | 164 // Otherwise, bind to the default FBO. |
| 165 void restoreFramebufferBindings(); | 165 void restoreFramebufferBindings(); |
| 166 | 166 |
| 167 void addNewMailboxCallback(PassOwnPtr<Closure> closure) { m_newMailboxCallba
ck = std::move(closure); } | 167 void addNewMailboxCallback(PassOwnPtr<Closure> closure) { m_newMailboxCallba
ck = std::move(closure); } |
| 168 | 168 |
| 169 protected: // For unittests | 169 protected: // For unittests |
| 170 struct PLATFORM_EXPORT SupportedExtensions { | |
| 171 SupportedExtensions(); | |
| 172 | |
| 173 bool multisample; | |
| 174 bool packedDepthStencil; | |
| 175 bool depth24; | |
| 176 bool discardFramebuffer; | |
| 177 }; | |
| 178 | |
| 179 DrawingBuffer( | 170 DrawingBuffer( |
| 180 PassOwnPtr<WebGraphicsContext3D>, | 171 PassOwnPtr<WebGraphicsContext3D>, |
| 181 PassOwnPtr<Extensions3DUtil>, | 172 PassOwnPtr<Extensions3DUtil>, |
| 182 const SupportedExtensions&, | 173 bool multisampleExtensionSupported, |
| 174 bool packedDepthStencilExtensionSupported, |
| 175 bool discardFramebufferSupported, |
| 183 PreserveDrawingBuffer, | 176 PreserveDrawingBuffer, |
| 184 WebGraphicsContext3D::Attributes requestedAttributes); | 177 WebGraphicsContext3D::Attributes requestedAttributes); |
| 185 | 178 |
| 186 bool initialize(const IntSize&); | 179 bool initialize(const IntSize&); |
| 187 | 180 |
| 188 private: | 181 private: |
| 189 struct TextureParameters { | 182 struct TextureParameters { |
| 190 DISALLOW_NEW(); | 183 DISALLOW_NEW(); |
| 191 WGC3Denum target; | 184 WGC3Denum target; |
| 192 WGC3Denum internalColorFormat; | 185 WGC3Denum internalColorFormat; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 Platform3DObject m_drawFramebufferBinding; | 292 Platform3DObject m_drawFramebufferBinding; |
| 300 Platform3DObject m_readFramebufferBinding; | 293 Platform3DObject m_readFramebufferBinding; |
| 301 GLenum m_activeTextureUnit; | 294 GLenum m_activeTextureUnit; |
| 302 | 295 |
| 303 OwnPtr<WebGraphicsContext3D> m_context; | 296 OwnPtr<WebGraphicsContext3D> m_context; |
| 304 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 297 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
| 305 IntSize m_size; | 298 IntSize m_size; |
| 306 WebGraphicsContext3D::Attributes m_requestedAttributes; | 299 WebGraphicsContext3D::Attributes m_requestedAttributes; |
| 307 bool m_multisampleExtensionSupported; | 300 bool m_multisampleExtensionSupported; |
| 308 bool m_packedDepthStencilExtensionSupported; | 301 bool m_packedDepthStencilExtensionSupported; |
| 309 bool m_depth24ExtensionSupported; | |
| 310 bool m_discardFramebufferSupported; | 302 bool m_discardFramebufferSupported; |
| 311 Platform3DObject m_fbo; | 303 Platform3DObject m_fbo; |
| 312 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. | 304 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. |
| 313 TextureInfo m_colorBuffer; | 305 TextureInfo m_colorBuffer; |
| 314 struct FrontBufferInfo { | 306 struct FrontBufferInfo { |
| 315 TextureInfo texInfo; | 307 TextureInfo texInfo; |
| 316 WebExternalTextureMailbox mailbox; | 308 WebExternalTextureMailbox mailbox; |
| 317 }; | 309 }; |
| 318 FrontBufferInfo m_frontColorBuffer; | 310 FrontBufferInfo m_frontColorBuffer; |
| 319 | 311 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // used to resize the Canvas. | 360 // used to resize the Canvas. |
| 369 SkBitmap m_resizingBitmap; | 361 SkBitmap m_resizingBitmap; |
| 370 | 362 |
| 371 // Used to flip a bitmap vertically. | 363 // Used to flip a bitmap vertically. |
| 372 Vector<uint8_t> m_scanline; | 364 Vector<uint8_t> m_scanline; |
| 373 }; | 365 }; |
| 374 | 366 |
| 375 } // namespace blink | 367 } // namespace blink |
| 376 | 368 |
| 377 #endif // DrawingBuffer_h | 369 #endif // DrawingBuffer_h |
| OLD | NEW |