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

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

Issue 2461423002: Reland "Fix HTML5 video blurry" (Closed)
Patch Set: rebase to ToT Created 4 years, 1 month 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
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
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"
23 #include "ui/gfx/geometry/size.h" 24 #include "ui/gfx/geometry/size.h"
24 25
25 namespace media { 26 namespace media {
26 class SkCanvasVideoRenderer; 27 class SkCanvasVideoRenderer;
27 class VideoFrame; 28 class VideoFrame;
28 } 29 }
29 30
30 namespace cc { 31 namespace cc {
31 class ContextProvider; 32 class ContextProvider;
32 class ResourceProvider; 33 class ResourceProvider;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // in the 0-1 range, you need to do: 97 // in the 0-1 range, you need to do:
97 // (half_float - Offset()) * Multiplier() 98 // (half_float - Offset()) * Multiplier()
98 // to each returned value. 99 // to each returned value.
99 virtual float Offset() const = 0; 100 virtual float Offset() const = 0;
100 virtual float Multiplier() const = 0; 101 virtual float Multiplier() const = 0;
101 }; 102 };
102 103
103 static std::unique_ptr<HalfFloatMaker> NewHalfFloatMaker( 104 static std::unique_ptr<HalfFloatMaker> NewHalfFloatMaker(
104 int bits_per_channel); 105 int bits_per_channel);
105 106
107 ResourceFormat YuvResourceFormat(int bits,
108 media::VideoPixelFormat format) const;
109
106 private: 110 private:
107 class PlaneResource { 111 class PlaneResource {
108 public: 112 public:
109 PlaneResource(unsigned resource_id, 113 PlaneResource(unsigned resource_id,
110 const gfx::Size& resource_size, 114 const gfx::Size& resource_size,
111 ResourceFormat resource_format, 115 ResourceFormat resource_format,
112 gpu::Mailbox mailbox); 116 gpu::Mailbox mailbox);
113 PlaneResource(const PlaneResource& other); 117 PlaneResource(const PlaneResource& other);
114 118
115 // Returns true if this resource matches the unique identifiers of another 119 // Returns true if this resource matches the unique identifiers of another
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // Recycle resources so that we can reduce the number of allocations and 207 // Recycle resources so that we can reduce the number of allocations and
204 // data transfers. 208 // data transfers.
205 ResourceList all_resources_; 209 ResourceList all_resources_;
206 210
207 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 211 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
208 }; 212 };
209 213
210 } // namespace cc 214 } // namespace cc
211 215
212 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 216 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698