OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
6 #define UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 class CompositorGL; | 25 class CompositorGL; |
26 class TextureProgramGL; | 26 class TextureProgramGL; |
27 | 27 |
28 // We share resources (such as shaders) between different Compositors via | 28 // We share resources (such as shaders) between different Compositors via |
29 // GLContext sharing so that we only have to create/destroy them once. | 29 // GLContext sharing so that we only have to create/destroy them once. |
30 class COMPOSITOR_EXPORT SharedResourcesGL : public SharedResources { | 30 class COMPOSITOR_EXPORT SharedResourcesGL : public SharedResources { |
31 public: | 31 public: |
32 static SharedResourcesGL* GetInstance(); | 32 static SharedResourcesGL* GetInstance(); |
33 | 33 |
34 virtual bool MakeSharedContextCurrent(); | 34 virtual gfx::ScopedMakeCurrent* GetScopedMakeCurrent() OVERRIDE; |
35 | |
36 // Creates an instance of ScopedMakeCurrent. | |
37 // Note: Caller is responsible for managing lifetime of returned pointer. | |
38 gfx::ScopedMakeCurrent* GetScopedMakeCurrent(); | |
39 | 35 |
40 // Creates a context that shares the resources hosted by this singleton. | 36 // Creates a context that shares the resources hosted by this singleton. |
41 scoped_refptr<gfx::GLContext> CreateContext(gfx::GLSurface* surface); | 37 scoped_refptr<gfx::GLContext> CreateContext(gfx::GLSurface* surface); |
42 | 38 |
43 virtual void* GetDisplay(); | 39 virtual void* GetDisplay(); |
44 | 40 |
45 ui::TextureProgramGL* program_no_swizzle() { | 41 ui::TextureProgramGL* program_no_swizzle() { |
46 return program_no_swizzle_.get(); | 42 return program_no_swizzle_.get(); |
47 } | 43 } |
48 | 44 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 123 |
128 // Keep track of whether compositing has started or not. | 124 // Keep track of whether compositing has started or not. |
129 bool started_; | 125 bool started_; |
130 | 126 |
131 DISALLOW_COPY_AND_ASSIGN(CompositorGL); | 127 DISALLOW_COPY_AND_ASSIGN(CompositorGL); |
132 }; | 128 }; |
133 | 129 |
134 } // namespace ui | 130 } // namespace ui |
135 | 131 |
136 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 132 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
OLD | NEW |