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

Side by Side Diff: mojo/ui/gl_renderer.h

Issue 1776643004: Mozart: Specify texture origin explicitly. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-3
Patch Set: Created 4 years, 9 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
« no previous file with comments | « mojo/ui/ganesh_renderer.cc ('k') | mojo/ui/gl_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « mojo/ui/ganesh_renderer.cc ('k') | mojo/ui/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698