| 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 "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/bitmap_uploader/bitmap_uploader_export.h" | 13 #include "components/bitmap_uploader/bitmap_uploader_export.h" |
| 14 #include "components/mus/public/cpp/window_surface.h" | 14 #include "components/mus/public/cpp/window_surface.h" |
| 15 #include "components/mus/public/interfaces/compositor_frame.mojom.h" | 15 #include "components/mus/public/interfaces/compositor_frame.mojom.h" |
| 16 #include "components/mus/public/interfaces/gpu.mojom.h" | 16 #include "components/mus/public/interfaces/gpu.mojom.h" |
| 17 #include "gpu/GLES2/gl2chromium.h" | 17 #include "gpu/GLES2/gl2chromium.h" |
| 18 #include "gpu/GLES2/gl2extchromium.h" | 18 #include "gpu/GLES2/gl2extchromium.h" |
| 19 #include "mojo/public/c/gles2/gles2.h" | 19 #include "mojo/public/c/gles2/gles2.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 namespace shell { | |
| 23 namespace mojom { | |
| 24 class Shell; | 22 class Shell; |
| 25 } | 23 } |
| 26 } | |
| 27 } | |
| 28 | 24 |
| 29 namespace bitmap_uploader { | 25 namespace bitmap_uploader { |
| 30 | 26 |
| 31 BITMAP_UPLOADER_EXPORT extern const char kBitmapUploaderForAcceleratedWidget[]; | 27 BITMAP_UPLOADER_EXPORT extern const char kBitmapUploaderForAcceleratedWidget[]; |
| 32 | 28 |
| 33 // BitmapUploader is useful if you want to draw a bitmap or color in a | 29 // BitmapUploader is useful if you want to draw a bitmap or color in a |
| 34 // mus::Window. | 30 // mus::Window. |
| 35 class BITMAP_UPLOADER_EXPORT BitmapUploader | 31 class BITMAP_UPLOADER_EXPORT BitmapUploader |
| 36 : NON_EXPORTED_BASE(public mus::mojom::SurfaceClient) { | 32 : NON_EXPORTED_BASE(public mus::mojom::SurfaceClient) { |
| 37 public: | 33 public: |
| 38 explicit BitmapUploader(mus::Window* window); | 34 explicit BitmapUploader(mus::Window* window); |
| 39 ~BitmapUploader() override; | 35 ~BitmapUploader() override; |
| 40 | 36 |
| 41 void Init(mojo::shell::mojom::Shell* shell); | 37 void Init(mojo::Shell* shell); |
| 42 | 38 |
| 43 // Sets the color which is RGBA. | 39 // Sets the color which is RGBA. |
| 44 void SetColor(uint32_t color); | 40 void SetColor(uint32_t color); |
| 45 | 41 |
| 46 enum Format { | 42 enum Format { |
| 47 RGBA, // Pixel layout on Android. | 43 RGBA, // Pixel layout on Android. |
| 48 BGRA, // Pixel layout everywhere else. | 44 BGRA, // Pixel layout everywhere else. |
| 49 }; | 45 }; |
| 50 | 46 |
| 51 // Sets a bitmap. | 47 // Sets a bitmap. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 uint32_t id_namespace_; | 80 uint32_t id_namespace_; |
| 85 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; | 81 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; |
| 86 mojo::Binding<mus::mojom::SurfaceClient> surface_client_binding_; | 82 mojo::Binding<mus::mojom::SurfaceClient> surface_client_binding_; |
| 87 | 83 |
| 88 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); | 84 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); |
| 89 }; | 85 }; |
| 90 | 86 |
| 91 } // namespace bitmap_uploader | 87 } // namespace bitmap_uploader |
| 92 | 88 |
| 93 #endif // COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLAODER_H_ | 89 #endif // COMPONENTS_BITMAP_UPLOADER_BITMAP_UPLAODER_H_ |
| OLD | NEW |