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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture, GLenum internalFormat, | 157 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject texture, GLenum internalFormat, |
158 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD rawingBuffer); | 158 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, SourceD rawingBuffer); |
159 | 159 |
160 void setPackAlignment(GLint param); | 160 void setPackAlignment(GLint param); |
161 | 161 |
162 void paintRenderingResultsToCanvas(ImageBuffer*); | 162 void paintRenderingResultsToCanvas(ImageBuffer*); |
163 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF:: ArrayBufferContents&); | 163 bool paintRenderingResultsToImageData(int&, int&, SourceDrawingBuffer, WTF:: ArrayBufferContents&); |
164 | 164 |
165 int sampleCount() const { return m_sampleCount; } | 165 int sampleCount() const { return m_sampleCount; } |
166 bool explicitResolveOfMultisampleData() const { return m_multisampleMode == ExplicitResolve; }; | 166 bool explicitResolveOfMultisampleData() const { return m_multisampleMode == ExplicitResolve; }; |
167 bool isRGBTextureSupported() const { return m_RGBTextureSupported; } | |
167 | 168 |
168 protected: // For unittests | 169 protected: // For unittests |
169 DrawingBuffer( | 170 DrawingBuffer( |
170 PassOwnPtr<WebGraphicsContext3D>, | 171 PassOwnPtr<WebGraphicsContext3D>, |
171 PassOwnPtr<Extensions3DUtil>, | 172 PassOwnPtr<Extensions3DUtil>, |
172 bool multisampleExtensionSupported, | 173 bool multisampleExtensionSupported, |
173 bool packedDepthStencilExtensionSupported, | 174 bool packedDepthStencilExtensionSupported, |
174 bool discardFramebufferSupported, | 175 bool discardFramebufferSupported, |
175 PreserveDrawingBuffer, | 176 PreserveDrawingBuffer, |
176 WebGraphicsContext3D::Attributes requestedAttributes); | 177 WebGraphicsContext3D::Attributes requestedAttributes); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 | 215 |
215 // Helper function to flip a bitmap vertically. | 216 // Helper function to flip a bitmap vertically. |
216 void flipVertically(uint8_t* data, int width, int height); | 217 void flipVertically(uint8_t* data, int width, int height); |
217 | 218 |
218 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. | 219 // Helper to texImage2D with pixel==0 case: pixels are initialized to 0. |
219 // By default, alignment is 4, the OpenGL default setting. | 220 // 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); | 221 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. | 222 // Allocate buffer storage to be sent to compositor using either texImage2D or CHROMIUM_image based on available support. |
222 void allocateTextureMemory(TextureInfo*, const IntSize&); | 223 void allocateTextureMemory(TextureInfo*, const IntSize&); |
223 void deleteChromiumImageForTexture(TextureInfo*); | 224 void deleteChromiumImageForTexture(TextureInfo*); |
225 void validateBackbuffer(); | |
Ken Russell (switch to Gerrit)
2015/04/06 21:43:18
Please name this something more obvious like "dete
| |
224 | 226 |
227 bool m_RGBTextureSupported; | |
225 PreserveDrawingBuffer m_preserveDrawingBuffer; | 228 PreserveDrawingBuffer m_preserveDrawingBuffer; |
226 bool m_scissorEnabled; | 229 bool m_scissorEnabled; |
227 Platform3DObject m_texture2DBinding; | 230 Platform3DObject m_texture2DBinding; |
228 Platform3DObject m_framebufferBinding; | 231 Platform3DObject m_framebufferBinding; |
229 GLenum m_activeTextureUnit; | 232 GLenum m_activeTextureUnit; |
230 | 233 |
231 OwnPtr<WebGraphicsContext3D> m_context; | 234 OwnPtr<WebGraphicsContext3D> m_context; |
232 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 235 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
233 IntSize m_size; | 236 IntSize m_size; |
234 WebGraphicsContext3D::Attributes m_requestedAttributes; | 237 WebGraphicsContext3D::Attributes m_requestedAttributes; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 // used to resize the Canvas. | 298 // used to resize the Canvas. |
296 SkBitmap m_resizingBitmap; | 299 SkBitmap m_resizingBitmap; |
297 | 300 |
298 // Used to flip a bitmap vertically. | 301 // Used to flip a bitmap vertically. |
299 Vector<uint8_t> m_scanline; | 302 Vector<uint8_t> m_scanline; |
300 }; | 303 }; |
301 | 304 |
302 } // namespace blink | 305 } // namespace blink |
303 | 306 |
304 #endif // DrawingBuffer_h | 307 #endif // DrawingBuffer_h |
OLD | NEW |