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

Side by Side 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: nits 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_
6 #define UI_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include "base/hash_tables.h" 8 #include "base/hash_tables.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Creates an output surface for the given compositor. The factory may keep 60 // Creates an output surface for the given compositor. The factory may keep
61 // per-compositor data (e.g. a shared context), that needs to be cleaned up 61 // per-compositor data (e.g. a shared context), that needs to be cleaned up
62 // by calling RemoveCompositor when the compositor gets destroyed. 62 // by calling RemoveCompositor when the compositor gets destroyed.
63 virtual cc::OutputSurface* CreateOutputSurface( 63 virtual cc::OutputSurface* CreateOutputSurface(
64 Compositor* compositor) = 0; 64 Compositor* compositor) = 0;
65 65
66 // Creates a context used for offscreen rendering. This context can be shared 66 // Creates a context used for offscreen rendering. This context can be shared
67 // with all compositors. 67 // with all compositors.
68 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() = 0; 68 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() = 0;
69 69
70 virtual WebKit::WebGraphicsContext3D*
71 OffscreenContextForMainThread() = 0;
72 virtual WebKit::WebGraphicsContext3D*
73 OffscreenContextForCompositorThread() = 0;
74 virtual GrContext*
75 OffscreenGrContextForMainThread() = 0;
76 virtual GrContext*
77 OffscreenGrContextForCompositorThread() = 0;
78
70 // Destroys per-compositor data. 79 // Destroys per-compositor data.
71 virtual void RemoveCompositor(Compositor* compositor) = 0; 80 virtual void RemoveCompositor(Compositor* compositor) = 0;
72 }; 81 };
73 82
74 // The default factory that creates in-process contexts. 83 // The default factory that creates in-process contexts.
75 class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory { 84 class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory {
76 public: 85 public:
77 DefaultContextFactory(); 86 DefaultContextFactory();
78 virtual ~DefaultContextFactory(); 87 virtual ~DefaultContextFactory();
79 88
80 // ContextFactory implementation 89 // ContextFactory implementation
81 virtual cc::OutputSurface* CreateOutputSurface( 90 virtual cc::OutputSurface* CreateOutputSurface(
82 Compositor* compositor) OVERRIDE; 91 Compositor* compositor) OVERRIDE;
83 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE; 92 virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE;
93 virtual WebKit::WebGraphicsContext3D*
94 OffscreenContextForMainThread() OVERRIDE;
95 virtual WebKit::WebGraphicsContext3D*
96 OffscreenContextForCompositorThread() OVERRIDE;
97 virtual GrContext*
98 OffscreenGrContextForMainThread() OVERRIDE;
99 virtual GrContext*
100 OffscreenGrContextForCompositorThread() OVERRIDE;
84 virtual void RemoveCompositor(Compositor* compositor) OVERRIDE; 101 virtual void RemoveCompositor(Compositor* compositor) OVERRIDE;
85 102
86 bool Initialize(); 103 bool Initialize();
87 104
88 void set_share_group(gfx::GLShareGroup* share_group) { 105 void set_share_group(gfx::GLShareGroup* share_group) {
89 share_group_ = share_group; 106 share_group_ = share_group;
90 } 107 }
91 108
92 private: 109 private:
93 WebKit::WebGraphicsContext3D* CreateContextCommon( 110 WebKit::WebGraphicsContext3D* CreateContextCommon(
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // LayerTreeHostClient implementation. 271 // LayerTreeHostClient implementation.
255 virtual void willBeginFrame() OVERRIDE; 272 virtual void willBeginFrame() OVERRIDE;
256 virtual void didBeginFrame() OVERRIDE; 273 virtual void didBeginFrame() OVERRIDE;
257 virtual void animate(double frameBeginTime) OVERRIDE; 274 virtual void animate(double frameBeginTime) OVERRIDE;
258 virtual void layout() OVERRIDE; 275 virtual void layout() OVERRIDE;
259 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, 276 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta,
260 float pageScale) OVERRIDE; 277 float pageScale) OVERRIDE;
261 virtual scoped_ptr<cc::OutputSurface> 278 virtual scoped_ptr<cc::OutputSurface>
262 createOutputSurface() OVERRIDE; 279 createOutputSurface() OVERRIDE;
263 virtual void didRecreateOutputSurface(bool success) OVERRIDE; 280 virtual void didRecreateOutputSurface(bool success) OVERRIDE;
281 virtual WebKit::WebGraphicsContext3D*
282 offscreenContext3dForMainThread() OVERRIDE;
283 virtual WebKit::WebGraphicsContext3D*
284 offscreenContext3dForCompositorThread() OVERRIDE;
285 virtual GrContext* offscreenGrContextForMainThread() OVERRIDE;
286 virtual GrContext* offscreenGrContextForCompositorThread()
287 OVERRIDE;
264 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE; 288 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE;
265 virtual void willCommit() OVERRIDE; 289 virtual void willCommit() OVERRIDE;
266 virtual void didCommit() OVERRIDE; 290 virtual void didCommit() OVERRIDE;
267 virtual void didCommitAndDrawFrame() OVERRIDE; 291 virtual void didCommitAndDrawFrame() OVERRIDE;
268 virtual void didCompleteSwapBuffers() OVERRIDE; 292 virtual void didCompleteSwapBuffers() OVERRIDE;
269 virtual void scheduleComposite() OVERRIDE; 293 virtual void scheduleComposite() OVERRIDE;
270 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE; 294 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE;
271 295
272 296
273 int last_started_frame() { return last_started_frame_; } 297 int last_started_frame() { return last_started_frame_; }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 bool disable_schedule_composite_; 337 bool disable_schedule_composite_;
314 338
315 CompositorLock* compositor_lock_; 339 CompositorLock* compositor_lock_;
316 340
317 DISALLOW_COPY_AND_ASSIGN(Compositor); 341 DISALLOW_COPY_AND_ASSIGN(Compositor);
318 }; 342 };
319 343
320 } // namespace ui 344 } // namespace ui
321 345
322 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 346 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698