| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ | 5 #ifndef EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ |
| 6 #define EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ | 6 #define EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 base::WeakPtr<mojo::GLContext> context); | 37 base::WeakPtr<mojo::GLContext> context); |
| 38 ~TextureUploader(); | 38 ~TextureUploader(); |
| 39 | 39 |
| 40 void Upload(scoped_ptr<mojo::GLTexture> texture); | 40 void Upload(scoped_ptr<mojo::GLTexture> texture); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // mojo::GLContext::Observer | 43 // mojo::GLContext::Observer |
| 44 void OnContextLost() override; | 44 void OnContextLost() override; |
| 45 | 45 |
| 46 // mojo::SurfaceClient | 46 // mojo::SurfaceClient |
| 47 void SetIdNamespace(uint32_t id_namespace) override; |
| 47 void ReturnResources( | 48 void ReturnResources( |
| 48 mojo::Array<mojo::ReturnedResourcePtr> resources) override; | 49 mojo::Array<mojo::ReturnedResourcePtr> resources) override; |
| 49 void OnSurfaceConnectionCreated(mojo::SurfacePtr surface, | 50 void OnSurfaceConnectionCreated(mojo::SurfacePtr surface, |
| 50 uint32_t id_namespace); | 51 uint32_t id_namespace); |
| 51 void EnsureSurfaceForSize(const mojo::Size& size); | 52 void EnsureSurfaceForSize(const mojo::Size& size); |
| 52 | 53 |
| 53 Client* client_; | 54 Client* client_; |
| 54 base::WeakPtr<mojo::GLContext> context_; | 55 base::WeakPtr<mojo::GLContext> context_; |
| 55 mojo::SurfacesServicePtr surfaces_service_; | 56 mojo::SurfacesServicePtr surfaces_service_; |
| 56 scoped_ptr<mojo::GLTexture> pending_upload_; | 57 scoped_ptr<mojo::GLTexture> pending_upload_; |
| 57 mojo::SurfacePtr surface_; | 58 mojo::SurfacePtr surface_; |
| 58 mojo::Size surface_size_; | 59 mojo::Size surface_size_; |
| 59 uint32_t next_resource_id_; | 60 uint32_t next_resource_id_; |
| 60 uint32_t id_namespace_; | 61 uint32_t id_namespace_; |
| 61 mojo::SurfaceIdPtr surface_id_; | 62 mojo::SurfaceIdPtr surface_id_; |
| 62 base::hash_map<uint32_t, mojo::GLTexture*> resource_to_texture_map_; | 63 base::hash_map<uint32_t, mojo::GLTexture*> resource_to_texture_map_; |
| 63 | 64 |
| 64 base::WeakPtrFactory<TextureUploader> weak_factory_; | 65 base::WeakPtrFactory<TextureUploader> weak_factory_; |
| 65 | 66 |
| 66 DISALLOW_COPY_AND_ASSIGN(TextureUploader); | 67 DISALLOW_COPY_AND_ASSIGN(TextureUploader); |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 } // namespace examples | 70 } // namespace examples |
| 70 | 71 |
| 71 #endif // EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ | 72 #endif // EXAMPLES_GANESH_APP_TEXTURE_UPLOADER_H_ |
| OLD | NEW |