diff options
Diffstat (limited to 'Source/WebKit/chromium/src/GraphicsContext3DPrivate.h')
| -rw-r--r-- | Source/WebKit/chromium/src/GraphicsContext3DPrivate.h | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h b/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h index f2d49a132..d296eeb9b 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h @@ -41,8 +41,7 @@ class GrContext; namespace WebKit { class WebGraphicsContext3D; -class WebViewImpl; -} // namespace WebKit +} namespace WebCore { @@ -51,25 +50,14 @@ class Extensions3DChromium; class GraphicsContextLostCallbackAdapter; class GraphicsContext3DSwapBuffersCompleteCallbackAdapter; class GraphicsErrorMessageCallbackAdapter; +class GraphicsContext3DMemoryAllocationChangedCallbackAdapter; class GraphicsContext3DPrivate { public: - static PassOwnPtr<GraphicsContext3DPrivate> create(WebKit::WebViewImpl*, PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::Attributes); - - enum ThreadUsage { - ForUseOnThisThread, - ForUseOnAnotherThread, - }; - - // createGraphicsContextForAnotherThread is equivalent to - // GraphicsContext3D::create, but will skip making the context - // current. Callers must make the context current before using it AND check - // that the context was created successfully via ContextLost. Once made - // current on a thread, the context cannot be used on any other thread. - static PassRefPtr<GraphicsContext3D> createGraphicsContextForAnotherThread(GraphicsContext3D::Attributes, HostWindow*, GraphicsContext3D::RenderStyle); - - // Used in tests to create a GraphicsContext3D from a mocked WebGraphicsContext3D. - static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::Attributes, HostWindow*, GraphicsContext3D::RenderStyle, ThreadUsage); + // Callers must make the context current before using it AND check that the context was created successfully + // via ContextLost before using the context in any way. Once made current on a thread, the context cannot + // be used on any other thread. + static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::RenderStyle, bool preserveDrawingBuffer = false); ~GraphicsContext3DPrivate(); @@ -97,7 +85,6 @@ public: void paintRenderingResultsToCanvas(CanvasRenderingContext*, DrawingBuffer*); void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*); PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*); - bool paintsIntoCanvasBuffer() const; bool paintCompositedResultsToCanvas(CanvasRenderingContext*); void prepareTexture(); @@ -295,6 +282,9 @@ public: // GL_CHROMIUM_set_visibility void setVisibilityCHROMIUM(bool); + // GL_CHROMIUM_gpu_memory_manager + void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM>); + // GL_CHROMIUM_framebuffer_multisample void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter); void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height); @@ -318,14 +308,14 @@ public: void texStorage2DEXT(GC3Denum target, GC3Dint levels, GC3Duint internalformat, GC3Dint width, GC3Dint height); private: - GraphicsContext3DPrivate(WebKit::WebViewImpl*, PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::Attributes); + GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer); OwnPtr<WebKit::WebGraphicsContext3D> m_impl; OwnPtr<Extensions3DChromium> m_extensions; OwnPtr<GraphicsContextLostCallbackAdapter> m_contextLostCallbackAdapter; OwnPtr<GraphicsErrorMessageCallbackAdapter> m_errorMessageCallbackAdapter; OwnPtr<GraphicsContext3DSwapBuffersCompleteCallbackAdapter> m_swapBuffersCompleteCallbackAdapter; - WebKit::WebViewImpl* m_webViewImpl; + OwnPtr<GraphicsContext3DMemoryAllocationChangedCallbackAdapter> m_memoryAllocationChangedCallbackAdapter; bool m_initializedAvailableExtensions; HashSet<String> m_enabledExtensions; HashSet<String> m_requestableExtensions; |
