Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: trunk/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 184343005: Revert 168457 "WebGL: Transfer ownership of WebGraphicsContext3D..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « trunk/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp ('k') | trunk/Source/platform/graphics/gpu/DrawingBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698