| 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "cc/base/cc_export.h" | 19 #include "cc/base/cc_export.h" |
| 20 #include "cc/resources/release_callback_impl.h" | 20 #include "cc/resources/release_callback_impl.h" |
| 21 #include "cc/resources/resource_format.h" | 21 #include "cc/resources/resource_format.h" |
| 22 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
| 23 #include "media/base/video_types.h" | |
| 24 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 25 | 24 |
| 26 namespace media { | 25 namespace media { |
| 27 class SkCanvasVideoRenderer; | 26 class SkCanvasVideoRenderer; |
| 28 class VideoFrame; | 27 class VideoFrame; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace cc { | 30 namespace cc { |
| 32 class ContextProvider; | 31 class ContextProvider; |
| 33 class ResourceProvider; | 32 class ResourceProvider; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // in the 0-1 range, you need to do: | 96 // in the 0-1 range, you need to do: |
| 98 // (half_float - Offset()) * Multiplier() | 97 // (half_float - Offset()) * Multiplier() |
| 99 // to each returned value. | 98 // to each returned value. |
| 100 virtual float Offset() const = 0; | 99 virtual float Offset() const = 0; |
| 101 virtual float Multiplier() const = 0; | 100 virtual float Multiplier() const = 0; |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 static std::unique_ptr<HalfFloatMaker> NewHalfFloatMaker( | 103 static std::unique_ptr<HalfFloatMaker> NewHalfFloatMaker( |
| 105 int bits_per_channel); | 104 int bits_per_channel); |
| 106 | 105 |
| 107 ResourceFormat YuvResourceFormat(int bits, | |
| 108 media::VideoPixelFormat format) const; | |
| 109 | |
| 110 private: | 106 private: |
| 111 class PlaneResource { | 107 class PlaneResource { |
| 112 public: | 108 public: |
| 113 PlaneResource(unsigned resource_id, | 109 PlaneResource(unsigned resource_id, |
| 114 const gfx::Size& resource_size, | 110 const gfx::Size& resource_size, |
| 115 ResourceFormat resource_format, | 111 ResourceFormat resource_format, |
| 116 gpu::Mailbox mailbox); | 112 gpu::Mailbox mailbox); |
| 117 PlaneResource(const PlaneResource& other); | 113 PlaneResource(const PlaneResource& other); |
| 118 | 114 |
| 119 // Returns true if this resource matches the unique identifiers of another | 115 // Returns true if this resource matches the unique identifiers of another |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Recycle resources so that we can reduce the number of allocations and | 203 // Recycle resources so that we can reduce the number of allocations and |
| 208 // data transfers. | 204 // data transfers. |
| 209 ResourceList all_resources_; | 205 ResourceList all_resources_; |
| 210 | 206 |
| 211 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 207 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
| 212 }; | 208 }; |
| 213 | 209 |
| 214 } // namespace cc | 210 } // namespace cc |
| 215 | 211 |
| 216 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 212 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
| OLD | NEW |