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 28 matching lines...) Expand all Loading... |
39 #include "public/platform/WebExternalTextureMailbox.h" | 39 #include "public/platform/WebExternalTextureMailbox.h" |
40 #include "public/platform/WebGraphicsContext3D.h" | 40 #include "public/platform/WebGraphicsContext3D.h" |
41 #include "third_party/khronos/GLES2/gl2.h" | 41 #include "third_party/khronos/GLES2/gl2.h" |
42 #include "third_party/khronos/GLES2/gl2ext.h" | 42 #include "third_party/khronos/GLES2/gl2ext.h" |
43 #include "third_party/skia/include/core/SkBitmap.h" | 43 #include "third_party/skia/include/core/SkBitmap.h" |
44 #include "wtf/Deque.h" | 44 #include "wtf/Deque.h" |
45 #include "wtf/Noncopyable.h" | 45 #include "wtf/Noncopyable.h" |
46 #include "wtf/OwnPtr.h" | 46 #include "wtf/OwnPtr.h" |
47 #include "wtf/PassOwnPtr.h" | 47 #include "wtf/PassOwnPtr.h" |
48 | 48 |
| 49 namespace gpu { |
| 50 namespace gles2 { |
| 51 class GLES2Interface; |
| 52 } |
| 53 } |
| 54 |
49 namespace WTF { | 55 namespace WTF { |
50 | |
51 class ArrayBufferContents; | 56 class ArrayBufferContents; |
52 | 57 } |
53 } // namespace WTF | |
54 | 58 |
55 namespace blink { | 59 namespace blink { |
56 | 60 |
57 class Extensions3DUtil; | 61 class Extensions3DUtil; |
58 class ImageBuffer; | 62 class ImageBuffer; |
59 class WebExternalBitmap; | 63 class WebExternalBitmap; |
60 class WebExternalTextureLayer; | 64 class WebExternalTextureLayer; |
61 class WebGraphicsContext3D; | 65 class WebGraphicsContext3D; |
62 class WebLayer; | 66 class WebLayer; |
63 | 67 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 172 |
169 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. | 173 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not
0. |
170 // Otherwise, bind to the default FBO. | 174 // Otherwise, bind to the default FBO. |
171 void restoreFramebufferBindings(); | 175 void restoreFramebufferBindings(); |
172 | 176 |
173 void addNewMailboxCallback(PassOwnPtr<SameThreadClosure> closure) { m_newMai
lboxCallback = std::move(closure); } | 177 void addNewMailboxCallback(PassOwnPtr<SameThreadClosure> closure) { m_newMai
lboxCallback = std::move(closure); } |
174 | 178 |
175 protected: // For unittests | 179 protected: // For unittests |
176 DrawingBuffer( | 180 DrawingBuffer( |
177 PassOwnPtr<WebGraphicsContext3D>, | 181 PassOwnPtr<WebGraphicsContext3D>, |
| 182 gpu::gles2::GLES2Interface*, |
178 PassOwnPtr<Extensions3DUtil>, | 183 PassOwnPtr<Extensions3DUtil>, |
179 bool multisampleExtensionSupported, | 184 bool multisampleExtensionSupported, |
180 bool discardFramebufferSupported, | 185 bool discardFramebufferSupported, |
181 PreserveDrawingBuffer, | 186 PreserveDrawingBuffer, |
182 WebGraphicsContext3D::Attributes requestedAttributes); | 187 WebGraphicsContext3D::Attributes requestedAttributes); |
183 | 188 |
184 bool initialize(const IntSize&); | 189 bool initialize(const IntSize&); |
185 | 190 |
186 private: | 191 private: |
187 struct TextureParameters { | 192 struct TextureParameters { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void attachColorBufferToCurrentFBO(); | 297 void attachColorBufferToCurrentFBO(); |
293 | 298 |
294 PreserveDrawingBuffer m_preserveDrawingBuffer; | 299 PreserveDrawingBuffer m_preserveDrawingBuffer; |
295 bool m_scissorEnabled; | 300 bool m_scissorEnabled; |
296 Platform3DObject m_texture2DBinding; | 301 Platform3DObject m_texture2DBinding; |
297 Platform3DObject m_drawFramebufferBinding; | 302 Platform3DObject m_drawFramebufferBinding; |
298 Platform3DObject m_readFramebufferBinding; | 303 Platform3DObject m_readFramebufferBinding; |
299 GLenum m_activeTextureUnit; | 304 GLenum m_activeTextureUnit; |
300 | 305 |
301 OwnPtr<WebGraphicsContext3D> m_context; | 306 OwnPtr<WebGraphicsContext3D> m_context; |
| 307 gpu::gles2::GLES2Interface* m_gl; // Lifetime is tied to the m_context. |
302 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 308 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
303 IntSize m_size; | 309 IntSize m_size; |
304 WebGraphicsContext3D::Attributes m_requestedAttributes; | 310 WebGraphicsContext3D::Attributes m_requestedAttributes; |
305 bool m_multisampleExtensionSupported; | 311 bool m_multisampleExtensionSupported; |
306 bool m_discardFramebufferSupported; | 312 bool m_discardFramebufferSupported; |
307 Platform3DObject m_fbo; | 313 Platform3DObject m_fbo; |
308 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. | 314 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. |
309 TextureInfo m_colorBuffer; | 315 TextureInfo m_colorBuffer; |
310 struct FrontBufferInfo { | 316 struct FrontBufferInfo { |
311 TextureInfo texInfo; | 317 TextureInfo texInfo; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // used to resize the Canvas. | 366 // used to resize the Canvas. |
361 SkBitmap m_resizingBitmap; | 367 SkBitmap m_resizingBitmap; |
362 | 368 |
363 // Used to flip a bitmap vertically. | 369 // Used to flip a bitmap vertically. |
364 Vector<uint8_t> m_scanline; | 370 Vector<uint8_t> m_scanline; |
365 }; | 371 }; |
366 | 372 |
367 } // namespace blink | 373 } // namespace blink |
368 | 374 |
369 #endif // DrawingBuffer_h | 375 #endif // DrawingBuffer_h |
OLD | NEW |