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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "wtf/PassOwnPtr.h" | 46 #include "wtf/PassOwnPtr.h" |
47 | 47 |
48 namespace blink { | 48 namespace blink { |
49 class WebExternalBitmap; | 49 class WebExternalBitmap; |
50 class WebExternalTextureLayer; | 50 class WebExternalTextureLayer; |
51 class WebGraphicsContext3D; | 51 class WebGraphicsContext3D; |
52 class WebLayer; | 52 class WebLayer; |
53 } | 53 } |
54 | 54 |
55 namespace WebCore { | 55 namespace WebCore { |
| 56 class Extensions3DUtil; |
56 class ImageData; | 57 class ImageData; |
57 class ImageBuffer; | 58 class ImageBuffer; |
58 | 59 |
59 // Abstract interface to allow basic context eviction management | 60 // Abstract interface to allow basic context eviction management |
60 class PLATFORM_EXPORT ContextEvictionManager : public RefCounted<ContextEviction
Manager> { | 61 class PLATFORM_EXPORT ContextEvictionManager : public RefCounted<ContextEviction
Manager> { |
61 public: | 62 public: |
62 virtual ~ContextEvictionManager() {}; | 63 virtual ~ContextEvictionManager() {}; |
63 | 64 |
64 virtual void forciblyLoseOldestContext(const String& reason) = 0; | 65 virtual void forciblyLoseOldestContext(const String& reason) = 0; |
65 virtual IntSize oldestContextSize() = 0; | 66 virtual IntSize oldestContextSize() = 0; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Destroys the TEXTURE_2D binding for the owned context | 133 // Destroys the TEXTURE_2D binding for the owned context |
133 bool copyToPlatformTexture(blink::WebGraphicsContext3D*, Platform3DObject te
xture, GLenum internalFormat, | 134 bool copyToPlatformTexture(blink::WebGraphicsContext3D*, Platform3DObject te
xture, GLenum internalFormat, |
134 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY); | 135 GLenum destType, GLint level, bool premultiplyAlpha, bool flipY); |
135 | 136 |
136 void setPackAlignment(GLint param); | 137 void setPackAlignment(GLint param); |
137 | 138 |
138 void paintRenderingResultsToCanvas(ImageBuffer*); | 139 void paintRenderingResultsToCanvas(ImageBuffer*); |
139 PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&); | 140 PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&); |
140 | 141 |
141 private: | 142 private: |
142 DrawingBuffer(PassOwnPtr<blink::WebGraphicsContext3D>, bool multisampleExten
sionSupported, | 143 DrawingBuffer( |
143 bool packedDepthStencilExtensionSupported, PreserveDrawingBuff
er, PassRefPtr<ContextEvictionManager>); | 144 PassOwnPtr<blink::WebGraphicsContext3D>, |
| 145 PassOwnPtr<Extensions3DUtil>, |
| 146 bool multisampleExtensionSupported, |
| 147 bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRe
fPtr<ContextEvictionManager>); |
144 | 148 |
145 bool initialize(const IntSize&); | 149 bool initialize(const IntSize&); |
146 void releaseResources(); | 150 void releaseResources(); |
147 | 151 |
148 unsigned createColorTexture(const IntSize& size = IntSize()); | 152 unsigned createColorTexture(const IntSize& size = IntSize()); |
149 // Create the depth/stencil and multisample buffers, if needed. | 153 // Create the depth/stencil and multisample buffers, if needed. |
150 void createSecondaryBuffers(); | 154 void createSecondaryBuffers(); |
151 bool resizeFramebuffer(const IntSize&); | 155 bool resizeFramebuffer(const IntSize&); |
152 bool resizeMultisampleFramebuffer(const IntSize&); | 156 bool resizeMultisampleFramebuffer(const IntSize&); |
153 void resizeDepthStencil(const IntSize&); | 157 void resizeDepthStencil(const IntSize&); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // By default, alignment is 4, the OpenGL default setting. | 193 // By default, alignment is 4, the OpenGL default setting. |
190 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); | 194 void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalforma
t, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLin
t alignment = 4); |
191 | 195 |
192 PreserveDrawingBuffer m_preserveDrawingBuffer; | 196 PreserveDrawingBuffer m_preserveDrawingBuffer; |
193 bool m_scissorEnabled; | 197 bool m_scissorEnabled; |
194 Platform3DObject m_texture2DBinding; | 198 Platform3DObject m_texture2DBinding; |
195 Platform3DObject m_framebufferBinding; | 199 Platform3DObject m_framebufferBinding; |
196 GLenum m_activeTextureUnit; | 200 GLenum m_activeTextureUnit; |
197 | 201 |
198 OwnPtr<blink::WebGraphicsContext3D> m_context; | 202 OwnPtr<blink::WebGraphicsContext3D> m_context; |
| 203 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
199 IntSize m_size; | 204 IntSize m_size; |
200 bool m_multisampleExtensionSupported; | 205 bool m_multisampleExtensionSupported; |
201 bool m_packedDepthStencilExtensionSupported; | 206 bool m_packedDepthStencilExtensionSupported; |
202 Platform3DObject m_fbo; | 207 Platform3DObject m_fbo; |
203 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. | 208 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff
er. |
204 Platform3DObject m_colorBuffer; | 209 Platform3DObject m_colorBuffer; |
205 Platform3DObject m_frontColorBuffer; | 210 Platform3DObject m_frontColorBuffer; |
206 | 211 |
207 // This is used when we have OES_packed_depth_stencil. | 212 // This is used when we have OES_packed_depth_stencil. |
208 Platform3DObject m_depthStencilBuffer; | 213 Platform3DObject m_depthStencilBuffer; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // used to resize the Canvas. | 259 // used to resize the Canvas. |
255 SkBitmap m_resizingBitmap; | 260 SkBitmap m_resizingBitmap; |
256 | 261 |
257 // Used to flip a bitmap vertically. | 262 // Used to flip a bitmap vertically. |
258 Vector<uint8_t> m_scanline; | 263 Vector<uint8_t> m_scanline; |
259 }; | 264 }; |
260 | 265 |
261 } // namespace WebCore | 266 } // namespace WebCore |
262 | 267 |
263 #endif // DrawingBuffer_h | 268 #endif // DrawingBuffer_h |
OLD | NEW |