OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Convert an array of short integers into an array of half-floats. | 83 // Convert an array of short integers into an array of half-floats. |
84 // |src| is an array of integers in range 0 .. 2^{bits_per_channel} - 1 | 84 // |src| is an array of integers in range 0 .. 2^{bits_per_channel} - 1 |
85 // |num| is number of entries in input and output array. | 85 // |num| is number of entries in input and output array. |
86 // The numbers stored in |dst| will be half floats in range 0.0..1.0 | 86 // The numbers stored in |dst| will be half floats in range 0.0..1.0 |
87 static void MakeHalfFloats(const uint16_t* src, | 87 static void MakeHalfFloats(const uint16_t* src, |
88 int bits_per_channel, | 88 int bits_per_channel, |
89 size_t num, | 89 size_t num, |
90 uint16_t* dst); | 90 uint16_t* dst); |
91 | 91 |
| 92 ResourceFormat YuvResourceFormat(int bits) const; |
| 93 |
92 private: | 94 private: |
93 class PlaneResource { | 95 class PlaneResource { |
94 public: | 96 public: |
95 PlaneResource(unsigned resource_id, | 97 PlaneResource(unsigned resource_id, |
96 const gfx::Size& resource_size, | 98 const gfx::Size& resource_size, |
97 ResourceFormat resource_format, | 99 ResourceFormat resource_format, |
98 gpu::Mailbox mailbox); | 100 gpu::Mailbox mailbox); |
99 PlaneResource(const PlaneResource& other); | 101 PlaneResource(const PlaneResource& other); |
100 | 102 |
101 // Returns true if this resource matches the unique identifiers of another | 103 // Returns true if this resource matches the unique identifiers of another |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Recycle resources so that we can reduce the number of allocations and | 191 // Recycle resources so that we can reduce the number of allocations and |
190 // data transfers. | 192 // data transfers. |
191 ResourceList all_resources_; | 193 ResourceList all_resources_; |
192 | 194 |
193 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 195 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
194 }; | 196 }; |
195 | 197 |
196 } // namespace cc | 198 } // namespace cc |
197 | 199 |
198 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 200 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
OLD | NEW |