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 MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.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 25 matching lines...) Expand all Loading... |
36 void SetColor(SkColor color); | 36 void SetColor(SkColor color); |
37 void SetBitmap(SkBitmap bitmap); | 37 void SetBitmap(SkBitmap bitmap); |
38 void SetDoneCallback(const base::Callback<void(SurfaceIdPtr)>& done_callback); | 38 void SetDoneCallback(const base::Callback<void(SurfaceIdPtr)>& done_callback); |
39 | 39 |
40 private: | 40 private: |
41 void Upload(); | 41 void Upload(); |
42 void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace); | 42 void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace); |
43 uint32_t BindTextureForSize(const gfx::Size size); | 43 uint32_t BindTextureForSize(const gfx::Size size); |
44 | 44 |
45 // SurfaceClient implementation. | 45 // SurfaceClient implementation. |
46 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE; | 46 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override; |
47 | 47 |
48 ViewManagerClientImpl* client_; | 48 ViewManagerClientImpl* client_; |
49 Id view_id_; | 49 Id view_id_; |
50 SurfacesServicePtr surfaces_service_; | 50 SurfacesServicePtr surfaces_service_; |
51 GpuPtr gpu_service_; | 51 GpuPtr gpu_service_; |
52 MojoGLES2Context gles2_context_; | 52 MojoGLES2Context gles2_context_; |
53 | 53 |
54 gfx::Size size_; | 54 gfx::Size size_; |
55 SkColor color_; | 55 SkColor color_; |
56 SkBitmap bitmap_; | 56 SkBitmap bitmap_; |
57 base::Callback<void(SurfaceIdPtr)> done_callback_; | 57 base::Callback<void(SurfaceIdPtr)> done_callback_; |
58 SurfacePtr surface_; | 58 SurfacePtr surface_; |
59 cc::SurfaceId id_; | 59 cc::SurfaceId id_; |
60 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; | 60 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; |
61 gfx::Size surface_size_; | 61 gfx::Size surface_size_; |
62 uint32_t next_resource_id_; | 62 uint32_t next_resource_id_; |
63 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; | 63 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; |
64 | 64 |
65 base::WeakPtrFactory<BitmapUploader> weak_factory_; | 65 base::WeakPtrFactory<BitmapUploader> weak_factory_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); | 67 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace mojo | 70 } // namespace mojo |
71 | 71 |
72 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ | 72 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_ |
OLD | NEW |