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 COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ | 5 #ifndef COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ |
6 #define COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ | 6 #define COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLOADER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "components/bitmap_uploader/bitmap_uploader_export.h" | 15 #include "components/bitmap_uploader/bitmap_uploader_export.h" |
16 #include "components/mus/public/cpp/window_surface.h" | 16 #include "components/mus/public/cpp/window_surface.h" |
17 #include "components/mus/public/cpp/window_surface_client.h" | 17 #include "components/mus/public/cpp/window_surface_client.h" |
18 #include "components/mus/public/interfaces/compositor_frame.mojom.h" | 18 #include "components/mus/public/interfaces/compositor_frame.mojom.h" |
19 #include "components/mus/public/interfaces/gpu.mojom.h" | 19 #include "components/mus/public/interfaces/gpu.mojom.h" |
20 #include "gpu/GLES2/gl2chromium.h" | 20 #include "gpu/GLES2/gl2chromium.h" |
21 #include "gpu/GLES2/gl2extchromium.h" | 21 #include "gpu/GLES2/gl2extchromium.h" |
22 #include "mojo/public/c/gles2/gles2.h" | 22 |
| 23 namespace mus { |
| 24 class GLES2Context; |
| 25 } |
23 | 26 |
24 namespace shell { | 27 namespace shell { |
25 class Connector; | 28 class Connector; |
26 } | 29 } |
27 | 30 |
28 namespace bitmap_uploader { | 31 namespace bitmap_uploader { |
29 | 32 |
30 BITMAP_UPLOADER_EXPORT extern const char kBitmapUploaderForAcceleratedWidget[]; | 33 BITMAP_UPLOADER_EXPORT extern const char kBitmapUploaderForAcceleratedWidget[]; |
31 | 34 |
32 // BitmapUploader is useful if you want to draw a bitmap or color in a | 35 // BitmapUploader is useful if you want to draw a bitmap or color in a |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void SetIdNamespace(uint32_t id_namespace); | 68 void SetIdNamespace(uint32_t id_namespace); |
66 | 69 |
67 // WindowSurfaceClient implementation. | 70 // WindowSurfaceClient implementation. |
68 void OnResourcesReturned( | 71 void OnResourcesReturned( |
69 mus::WindowSurface* surface, | 72 mus::WindowSurface* surface, |
70 mojo::Array<mus::mojom::ReturnedResourcePtr> resources) override; | 73 mojo::Array<mus::mojom::ReturnedResourcePtr> resources) override; |
71 | 74 |
72 mus::Window* window_; | 75 mus::Window* window_; |
73 mus::mojom::GpuPtr gpu_service_; | 76 mus::mojom::GpuPtr gpu_service_; |
74 std::unique_ptr<mus::WindowSurface> surface_; | 77 std::unique_ptr<mus::WindowSurface> surface_; |
75 MojoGLES2Context gles2_context_; | 78 std::unique_ptr<mus::GLES2Context> gles2_context_; |
76 | 79 |
77 mojo::Size size_; | 80 mojo::Size size_; |
78 uint32_t color_; | 81 uint32_t color_; |
79 int width_; | 82 int width_; |
80 int height_; | 83 int height_; |
81 Format format_; | 84 Format format_; |
82 std::unique_ptr<std::vector<unsigned char>> bitmap_; | 85 std::unique_ptr<std::vector<unsigned char>> bitmap_; |
83 uint32_t next_resource_id_; | 86 uint32_t next_resource_id_; |
84 uint32_t id_namespace_; | 87 uint32_t id_namespace_; |
85 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; | 88 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); | 90 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace bitmap_uploader | 93 } // namespace bitmap_uploader |
91 | 94 |
92 #endif // COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLAODER_H_ | 95 #endif // COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLAODER_H_ |
OLD | NEW |