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

Side by Side Diff: examples/bitmap_uploader/bitmap_uploader.h

Issue 807733002: Split surface id and simplify connecting to surfaces service (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
OLDNEW
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_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ 5 #ifndef EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
6 #define EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ 6 #define EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 scoped_ptr<std::vector<unsigned char>> data, 42 scoped_ptr<std::vector<unsigned char>> data,
43 Format format); 43 Format format);
44 44
45 private: 45 private:
46 void Upload(); 46 void Upload();
47 void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace); 47 void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace);
48 uint32_t BindTextureForSize(const Size size); 48 uint32_t BindTextureForSize(const Size size);
49 uint32_t TextureFormat(); 49 uint32_t TextureFormat();
50 50
51 // SurfaceClient implementation. 51 // SurfaceClient implementation.
52 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override; 52 void SetIdNamespace(uint32_t id_namespace) override;
53 void ReturnResources(Array<ReturnedResourcePtr> resources) override;
53 54
54 View* view_; 55 View* view_;
55 SurfacesServicePtr surfaces_service_; 56 SurfacesServicePtr surfaces_service_;
56 GpuPtr gpu_service_; 57 GpuPtr gpu_service_;
57 MojoGLES2Context gles2_context_; 58 MojoGLES2Context gles2_context_;
58 59
59 Size size_; 60 Size size_;
60 uint32_t color_; 61 uint32_t color_;
61 int width_; 62 int width_;
62 int height_; 63 int height_;
63 Format format_; 64 Format format_;
64 scoped_ptr<std::vector<unsigned char>> bitmap_; 65 scoped_ptr<std::vector<unsigned char>> bitmap_;
65 SurfacePtr surface_; 66 SurfacePtr surface_;
66 Size surface_size_; 67 Size surface_size_;
67 uint32_t next_resource_id_; 68 uint32_t next_resource_id_;
68 uint32_t id_namespace_; 69 uint32_t id_namespace_;
69 SurfaceIdPtr surface_id_; 70 SurfaceIdPtr surface_id_;
70 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; 71 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_;
71 72
72 base::WeakPtrFactory<BitmapUploader> weak_factory_; 73 base::WeakPtrFactory<BitmapUploader> weak_factory_;
73 74
74 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); 75 DISALLOW_COPY_AND_ASSIGN(BitmapUploader);
75 }; 76 };
76 77
77 } // namespace mojo 78 } // namespace mojo
78 79
79 #endif // EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ 80 #endif // EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
OLDNEW
« no previous file with comments | « no previous file | examples/bitmap_uploader/bitmap_uploader.cc » ('j') | examples/surfaces_app/embedder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698