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

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

Issue 223223003: Re-land "WebGL: Transfer ownership of WebGraphicsContext3D to DrawingBuffer" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix errata on comment Created 6 years, 8 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: Source/platform/graphics/gpu/DrawingBuffer.h
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h
index c1526315b9f9bec4a0cf3563e4ae69bd90e71de5..b74f4cf2fbb0ebd5241016bf5986b8ea396a1b68 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -79,24 +79,19 @@ public:
Discard
};
- static PassRefPtr<DrawingBuffer> create(blink::WebGraphicsContext3D*, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
+ static PassRefPtr<DrawingBuffer> create(PassOwnPtr<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&);
- void reset(const IntSize&);
+ bool 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);
@@ -144,10 +139,11 @@ public:
PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&);
private:
- DrawingBuffer(blink::WebGraphicsContext3D*, const IntSize&, bool multisampleExtensionSupported,
+ DrawingBuffer(PassOwnPtr<blink::WebGraphicsContext3D>, bool multisampleExtensionSupported,
bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
- void initialize(const IntSize&);
+ bool initialize(const IntSize&);
+ void releaseResources();
unsigned createColorTexture(const IntSize& size = IntSize());
// Create the depth/stencil and multisample buffers, if needed.
@@ -199,7 +195,7 @@ private:
Platform3DObject m_framebufferBinding;
GLenum m_activeTextureUnit;
- blink::WebGraphicsContext3D* m_context;
+ OwnPtr<blink::WebGraphicsContext3D> m_context;
IntSize m_size;
bool m_multisampleExtensionSupported;
bool m_packedDepthStencilExtensionSupported;
« no previous file with comments | « Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp ('k') | Source/platform/graphics/gpu/DrawingBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698