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 SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ | 5 #ifndef SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ |
6 #define SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ | 6 #define SERVICES_UI_DEMO_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 "cc/output/compositor_frame_sink_client.h" | 15 #include "cc/output/compositor_frame_sink_client.h" |
16 #include "gpu/GLES2/gl2chromium.h" | 16 #include "gpu/GLES2/gl2chromium.h" |
17 #include "gpu/GLES2/gl2extchromium.h" | 17 #include "gpu/GLES2/gl2extchromium.h" |
18 #include "services/ui/public/cpp/compositor_frame_sink.h" | 18 #include "services/ui/public/cpp/window_compositor_frame_sink.h" |
19 #include "services/ui/public/cpp/window_surface.h" | |
20 #include "services/ui/public/cpp/window_surface_client.h" | |
21 | 19 |
22 namespace ui { | 20 namespace ui { |
23 class GLES2Context; | 21 |
24 class GpuService; | 22 class GpuService; |
| 23 class Window; |
25 | 24 |
26 extern const char kBitmapUploaderForAcceleratedWidget[]; | 25 extern const char kBitmapUploaderForAcceleratedWidget[]; |
27 | 26 |
28 // BitmapUploader is useful if you want to draw a bitmap or color in a | 27 // BitmapUploader is useful if you want to draw a bitmap or color in a |
29 // Window. | 28 // Window. |
30 class BitmapUploader : public cc::CompositorFrameSinkClient { | 29 class BitmapUploader : public cc::CompositorFrameSinkClient { |
31 public: | 30 public: |
32 explicit BitmapUploader(Window* window); | 31 explicit BitmapUploader(Window* window); |
33 ~BitmapUploader() override; | 32 ~BitmapUploader() override; |
34 | 33 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void DidLoseCompositorFrameSink() override; | 65 void DidLoseCompositorFrameSink() override; |
67 void OnDraw(const gfx::Transform& transform, | 66 void OnDraw(const gfx::Transform& transform, |
68 const gfx::Rect& viewport, | 67 const gfx::Rect& viewport, |
69 bool resourceless_software_draw) override; | 68 bool resourceless_software_draw) override; |
70 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; | 69 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; |
71 void SetExternalTilePriorityConstraints( | 70 void SetExternalTilePriorityConstraints( |
72 const gfx::Rect& viewport_rect, | 71 const gfx::Rect& viewport_rect, |
73 const gfx::Transform& transform) override; | 72 const gfx::Transform& transform) override; |
74 | 73 |
75 Window* window_; | 74 Window* window_; |
76 std::unique_ptr<CompositorFrameSink> compositor_frame_sink_; | 75 std::unique_ptr<WindowCompositorFrameSink> compositor_frame_sink_; |
77 | 76 |
78 uint32_t color_; | 77 uint32_t color_; |
79 int width_; | 78 int width_; |
80 int height_; | 79 int height_; |
81 Format format_; | 80 Format format_; |
82 std::unique_ptr<std::vector<unsigned char>> bitmap_; | 81 std::unique_ptr<std::vector<unsigned char>> bitmap_; |
83 uint32_t next_resource_id_; | 82 uint32_t next_resource_id_; |
84 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; | 83 base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_; |
85 | 84 |
86 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); | 85 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); |
87 }; | 86 }; |
88 | 87 |
89 } // namespace ui | 88 } // namespace ui |
90 | 89 |
91 #endif // SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ | 90 #endif // SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ |
OLD | NEW |