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