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

Unified Diff: media/base/video_color_space.cc

Issue 2841813002: Converting video color space enums to their corresponding gfx:color space eqvivalent. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« media/base/video_color_space.h ('K') | « media/base/video_color_space.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_color_space.cc
diff --git a/media/base/video_color_space.cc b/media/base/video_color_space.cc
index 036cd57f92050a4d55eaccd4fdc0fbc3c7bf7c88..861bbb9891606e539595502a8f3e93a466ec4669 100644
--- a/media/base/video_color_space.cc
+++ b/media/base/video_color_space.cc
@@ -41,7 +41,11 @@ VideoColorSpace::VideoColorSpace(int primaries,
: primaries(GetPrimaryID(primaries)),
transfer(GetTransferID(transfer)),
matrix(GetMatrixID(matrix)),
- range(range) {}
+ range(range) {
+ primaries_union.primaries = GetPrimaryID(primaries);
+ transfer_union.transfer = GetTransferID(transfer);
+ matrix_union.matrix = GetMatrixID(matrix);
+}
bool VideoColorSpace::operator==(const VideoColorSpace& other) const {
return primaries == other.primaries && transfer == other.transfer &&
@@ -54,10 +58,9 @@ bool VideoColorSpace::operator!=(const VideoColorSpace& other) const {
}
gfx::ColorSpace VideoColorSpace::ToGfxColorSpace() const {
- // TODO(hubbe): Make this type-safe.
- return gfx::ColorSpace::CreateVideo(static_cast<int>(primaries),
- static_cast<int>(transfer),
- static_cast<int>(matrix), range);
+ return gfx::ColorSpace::CreateVideo(primaries_union.primary_id,
+ transfer_union.transfer_id,
+ matrix_union.matrix_id, range);
}
VideoColorSpace VideoColorSpace::REC709() {
« media/base/video_color_space.h ('K') | « media/base/video_color_space.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698