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

Unified Diff: ui/compositor/compositor.h

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the GrContextProvider::ScopedContexts guard classes Created 7 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: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index aa773b25e7c330e3ad10c1908666fe60ed8e61e5..90776b7b4f680ad5c9bfd895640f58f0521ac2da 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -36,6 +36,12 @@ namespace WebKit {
class WebGraphicsContext3D;
}
+namespace webkit {
+namespace gpu {
+class GrContextForWebGraphicsContext3D;
+}
+}
+
namespace ui {
class Compositor;
@@ -67,6 +73,13 @@ class COMPOSITOR_EXPORT ContextFactory {
// with all compositors.
virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() = 0;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContextForMainThread() = 0;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContextForCompositorThread() =
+ 0;
+ virtual GrContext* OffscreenGrContextForMainThread() = 0;
+ virtual GrContext* OffscreenGrContextForCompositorThread() = 0;
+ virtual void DestroyOffscreenContext3dForCompositorThread() = 0;
+
// Destroys per-compositor data.
virtual void RemoveCompositor(Compositor* compositor) = 0;
};
@@ -81,6 +94,13 @@ class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory {
virtual cc::OutputSurface* CreateOutputSurface(
Compositor* compositor) OVERRIDE;
virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContextForMainThread()
+ OVERRIDE;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContextForCompositorThread()
+ OVERRIDE;
+ virtual GrContext* OffscreenGrContextForMainThread() OVERRIDE;
+ virtual GrContext* OffscreenGrContextForCompositorThread() OVERRIDE;
+ virtual void DestroyOffscreenContext3dForCompositorThread() OVERRIDE;
virtual void RemoveCompositor(Compositor* compositor) OVERRIDE;
bool Initialize();
@@ -95,6 +115,13 @@ class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory {
bool offscreen);
scoped_refptr<gfx::GLShareGroup> share_group_;
+ scoped_ptr<WebKit::WebGraphicsContext3D> test_offscreen_context_main_thread_;
+ scoped_ptr<WebKit::WebGraphicsContext3D>
+ test_offscreen_context_compositor_thread_;
+ scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D>
+ grcontext_main_thread_;
+ scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D>
+ grcontext_compositor_thread_;
DISALLOW_COPY_AND_ASSIGN(DefaultContextFactory);
};
@@ -261,6 +288,13 @@ class COMPOSITOR_EXPORT Compositor
virtual scoped_ptr<cc::OutputSurface>
createOutputSurface() OVERRIDE;
virtual void didRecreateOutputSurface(bool success) OVERRIDE;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContext3dForMainThread()
+ OVERRIDE;
+ virtual WebKit::WebGraphicsContext3D* OffscreenContext3dForCompositorThread()
+ OVERRIDE;
+ virtual GrContext* OffscreenGrContextForMainThread() OVERRIDE;
+ virtual GrContext* OffscreenGrContextForCompositorThread() OVERRIDE;
+ virtual void DestroyOffscreenContext3dForCompositorThread() OVERRIDE;
virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE;
virtual void willCommit() OVERRIDE;
virtual void didCommit() OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698