OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_GPU_TEXTURE_UPLOADER_H_ | |
6 #define MOJO_GPU_TEXTURE_UPLOADER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "mojo/gpu/gl_context.h" | |
11 #include "mojo/gpu/gl_texture.h" | |
12 #include "mojo/services/surfaces/interfaces/surfaces.mojom.h" | |
13 | |
14 namespace mojo { | |
15 | |
16 // Utility class for uploading textures to a surface. | |
17 class TextureUploader { | |
18 public: | |
19 // Gets a FramePtr for uploading to a to a SurfacePtr using |texture| as a | |
20 // transferable resource with id |resource_id|. | |
21 static mojo::FramePtr GetUploadFrame( | |
22 base::WeakPtr<mojo::GLContext> context, | |
23 uint32_t resource_id, | |
24 const scoped_ptr<mojo::GLTexture>& texture); | |
25 | |
26 private: | |
27 TextureUploader(); | |
28 ~TextureUploader(); | |
29 DISALLOW_COPY_AND_ASSIGN(TextureUploader); | |
30 }; | |
31 | |
32 } // namespace mojo | |
33 | |
34 #endif // MOJO_GPU_TEXTURE_UPLOADER_H_ | |
OLD | NEW |