OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MOJO_UI_GL_RENDERER_H_ | 5 #ifndef MOJO_UI_GL_RENDERER_H_ |
6 #define MOJO_UI_GL_RENDERER_H_ | 6 #define MOJO_UI_GL_RENDERER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Obtains a texture of the specified size. | 41 // Obtains a texture of the specified size. |
42 // Returns a nullptr if the GLContext was destroyed. | 42 // Returns a nullptr if the GLContext was destroyed. |
43 std::unique_ptr<mojo::GLTexture> GetTexture(const mojo::Size& requested_size); | 43 std::unique_ptr<mojo::GLTexture> GetTexture(const mojo::Size& requested_size); |
44 | 44 |
45 // Takes ownership of the specified texture, issues GL commands to | 45 // Takes ownership of the specified texture, issues GL commands to |
46 // produce a mailbox texture, and returns its resource pointer. | 46 // produce a mailbox texture, and returns its resource pointer. |
47 // The caller should add the resource to its scene. | 47 // The caller should add the resource to its scene. |
48 // Returns a nullptr if the GLContext was destroyed. | 48 // Returns a nullptr if the GLContext was destroyed. |
49 mojo::gfx::composition::ResourcePtr BindTextureResource( | 49 mojo::gfx::composition::ResourcePtr BindTextureResource( |
50 std::unique_ptr<GLTexture> texture); | 50 std::unique_ptr<GLTexture> texture, |
| 51 mojo::gfx::composition::MailboxTextureResource::Origin origin = |
| 52 mojo::gfx::composition::MailboxTextureResource::Origin::BOTTOM_LEFT); |
51 | 53 |
52 // Allocates a GL texture, binds it to a framebuffer, invokes the | 54 // Allocates a GL texture, binds it to a framebuffer, invokes the |
53 // provided function, then returns the resulting resource. | 55 // provided function, then returns the resulting resource. |
54 // If |with_depth| is true, provides a depth buffer attachment. | 56 // If |with_depth| is true, provides a depth buffer attachment. |
55 mojo::gfx::composition::ResourcePtr DrawGL(const mojo::Size& size, | 57 mojo::gfx::composition::ResourcePtr DrawGL(const mojo::Size& size, |
56 bool with_depth, | 58 bool with_depth, |
57 const DrawGLCallback& callback); | 59 const DrawGLCallback& callback); |
58 | 60 |
59 private: | 61 private: |
60 using GLRecycledTextureInfo = | 62 using GLRecycledTextureInfo = |
(...skipping 29 matching lines...) Expand all Loading... |
90 | 92 |
91 base::WeakPtrFactory<mojo::ui::GLRenderer> weak_factory_; | 93 base::WeakPtrFactory<mojo::ui::GLRenderer> weak_factory_; |
92 | 94 |
93 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 95 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
94 }; | 96 }; |
95 | 97 |
96 } // namespace ui | 98 } // namespace ui |
97 } // namespace mojo | 99 } // namespace mojo |
98 | 100 |
99 #endif // MOJO_UI_GL_RENDERER_H_ | 101 #endif // MOJO_UI_GL_RENDERER_H_ |
OLD | NEW |