Index: trunk/Source/platform/graphics/gpu/DrawingBuffer.h |
=================================================================== |
--- trunk/Source/platform/graphics/gpu/DrawingBuffer.h (revision 168480) |
+++ trunk/Source/platform/graphics/gpu/DrawingBuffer.h (working copy) |
@@ -79,19 +79,24 @@ |
Discard |
}; |
- static PassRefPtr<DrawingBuffer> create(PassOwnPtr<blink::WebGraphicsContext3D>, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>); |
+ static PassRefPtr<DrawingBuffer> create(blink::WebGraphicsContext3D*, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>); |
virtual ~DrawingBuffer(); |
+ // Clear all resources from this object, as well as context. Called when context is destroyed |
+ // to prevent invalid accesses to the resources. |
+ void releaseResources(); |
+ |
// Issues a glClear() on all framebuffers associated with this DrawingBuffer. The caller is responsible for |
// making the context current and setting the clear values and masks. Modifies the framebuffer binding. |
void clearFramebuffers(GLbitfield clearMask); |
// Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget. |
IntSize adjustSize(const IntSize&); |
- bool reset(const IntSize&); |
+ void reset(const IntSize&); |
void bind(); |
IntSize size() const { return m_size; } |
+ bool isZeroSized() const { return m_size.isEmpty(); } |
// Copies the multisample color buffer to the normal color buffer and leaves m_fbo bound. |
void commit(long x = 0, long y = 0, long width = -1, long height = -1); |
@@ -138,11 +143,10 @@ |
PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&); |
private: |
- DrawingBuffer(PassOwnPtr<blink::WebGraphicsContext3D>, bool multisampleExtensionSupported, |
+ DrawingBuffer(blink::WebGraphicsContext3D*, const IntSize&, bool multisampleExtensionSupported, |
bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>); |
- bool initialize(const IntSize&); |
- void releaseResources(); |
+ void initialize(const IntSize&); |
unsigned createColorTexture(const IntSize& size = IntSize()); |
// Create the depth/stencil and multisample buffers, if needed. |
@@ -194,7 +198,7 @@ |
Platform3DObject m_framebufferBinding; |
GLenum m_activeTextureUnit; |
- OwnPtr<blink::WebGraphicsContext3D> m_context; |
+ blink::WebGraphicsContext3D* m_context; |
IntSize m_size; |
bool m_multisampleExtensionSupported; |
bool m_packedDepthStencilExtensionSupported; |