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> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // Sets a bitmap. | 48 // Sets a bitmap. |
49 void SetBitmap(int width, | 49 void SetBitmap(int width, |
50 int height, | 50 int height, |
51 std::unique_ptr<std::vector<unsigned char>> data, | 51 std::unique_ptr<std::vector<unsigned char>> data, |
52 Format format); | 52 Format format); |
53 | 53 |
54 private: | 54 private: |
55 void Upload(); | 55 void Upload(); |
56 | 56 |
57 void OnGpuChannelEstablished(scoped_refptr<gpu::GpuChannelHost> gpu_channel); | 57 void OnGpuChannelEstablished( |
| 58 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 59 scoped_refptr<gpu::GpuChannelHost> gpu_channel); |
58 | 60 |
59 uint32_t BindTextureForSize(const gfx::Size& size); | 61 uint32_t BindTextureForSize(const gfx::Size& size); |
60 | 62 |
61 uint32_t TextureFormat() const { | 63 uint32_t TextureFormat() const { |
62 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA; | 64 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA; |
63 } | 65 } |
64 | 66 |
65 void SetIdNamespace(uint32_t id_namespace); | 67 void SetIdNamespace(uint32_t id_namespace); |
66 | 68 |
67 // cc::CompositorFrameSinkClient implementation. | 69 // cc::CompositorFrameSinkClient implementation. |
(...skipping 22 matching lines...) Expand all Loading... |
90 std::unordered_map<uint32_t, uint32_t> resource_to_texture_id_map_; | 92 std::unordered_map<uint32_t, uint32_t> resource_to_texture_id_map_; |
91 | 93 |
92 base::WeakPtrFactory<BitmapUploader> weak_factory_; | 94 base::WeakPtrFactory<BitmapUploader> weak_factory_; |
93 | 95 |
94 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); | 96 DISALLOW_COPY_AND_ASSIGN(BitmapUploader); |
95 }; | 97 }; |
96 | 98 |
97 } // namespace ui | 99 } // namespace ui |
98 | 100 |
99 #endif // SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ | 101 #endif // SERVICES_UI_DEMO_BITMAP_UPLOADER_H_ |
OLD | NEW |