Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: cc/resources/video_resource_updater.h

Issue 2122573003: media: replace LUMINANCE_F16 by RG_88 for 9/10-bit h264 videos Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 RGBA_PREMULTIPLIED_RESOURCE, 42 RGBA_PREMULTIPLIED_RESOURCE,
43 RGBA_RESOURCE, 43 RGBA_RESOURCE,
44 STREAM_TEXTURE_RESOURCE, 44 STREAM_TEXTURE_RESOURCE,
45 45
46 // TODO(danakj): Remove this and abstract TextureMailbox into 46 // TODO(danakj): Remove this and abstract TextureMailbox into
47 // "ExternalResource" that can hold a hardware or software backing. 47 // "ExternalResource" that can hold a hardware or software backing.
48 SOFTWARE_RESOURCE 48 SOFTWARE_RESOURCE
49 }; 49 };
50 50
51 ResourceType type; 51 ResourceType type;
52 ResourceFormat format;
52 std::vector<TextureMailbox> mailboxes; 53 std::vector<TextureMailbox> mailboxes;
53 std::vector<ReleaseCallbackImpl> release_callbacks; 54 std::vector<ReleaseCallbackImpl> release_callbacks;
54 bool read_lock_fences_enabled; 55 bool read_lock_fences_enabled;
55 56
56 // TODO(danakj): Remove these too. 57 // TODO(danakj): Remove these too.
57 std::vector<unsigned> software_resources; 58 std::vector<unsigned> software_resources;
58 ReleaseCallbackImpl software_release_callback; 59 ReleaseCallbackImpl software_release_callback;
59 60
60 // Used by hardware textures which do not return values in the 0-1 range. 61 // Used by hardware textures which do not return values in the 0-1 range.
61 // After a lookup, subtract offset and multiply by multiplier. 62 // After a lookup, subtract offset and multiply by multiplier.
(...skipping 20 matching lines...) Expand all
82 83
83 // Convert an array of short integers into an array of half-floats. 84 // 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 85 // |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. 86 // |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 87 // The numbers stored in |dst| will be half floats in range 0.0..1.0
87 static void MakeHalfFloats(const uint16_t* src, 88 static void MakeHalfFloats(const uint16_t* src,
88 int bits_per_channel, 89 int bits_per_channel,
89 size_t num, 90 size_t num,
90 uint16_t* dst); 91 uint16_t* dst);
91 92
93 ResourceFormat YuvResourceFormat(int bits) const;
94 void UseRGForTesting(bool use_rg_for_testing) {
95 use_rg_for_testing_ = use_rg_for_testing;
96 }
97
92 private: 98 private:
93 class PlaneResource { 99 class PlaneResource {
94 public: 100 public:
95 PlaneResource(unsigned resource_id, 101 PlaneResource(unsigned resource_id,
96 const gfx::Size& resource_size, 102 const gfx::Size& resource_size,
97 ResourceFormat resource_format, 103 ResourceFormat resource_format,
98 gpu::Mailbox mailbox); 104 gpu::Mailbox mailbox);
99 PlaneResource(const PlaneResource& other); 105 PlaneResource(const PlaneResource& other);
100 106
101 // Returns true if this resource matches the unique identifiers of another 107 // Returns true if this resource matches the unique identifiers of another
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 189
184 ContextProvider* context_provider_; 190 ContextProvider* context_provider_;
185 ResourceProvider* resource_provider_; 191 ResourceProvider* resource_provider_;
186 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; 192 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_;
187 std::vector<uint8_t> upload_pixels_; 193 std::vector<uint8_t> upload_pixels_;
188 194
189 // Recycle resources so that we can reduce the number of allocations and 195 // Recycle resources so that we can reduce the number of allocations and
190 // data transfers. 196 // data transfers.
191 ResourceList all_resources_; 197 ResourceList all_resources_;
192 198
199 bool use_rg_for_testing_ = false;
200
193 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 201 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
194 }; 202 };
195 203
196 } // namespace cc 204 } // namespace cc
197 205
198 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 206 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698