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

Unified Diff: webrtc/modules/desktop_capture/rgba_color.h

Issue 2334853002: Use RgbaColor in DesktopFrameGenerator and add RgbaColorTest (Closed)
Patch Set: Created 4 years, 3 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
Index: webrtc/modules/desktop_capture/rgba_color.h
diff --git a/webrtc/modules/desktop_capture/rgba_color.h b/webrtc/modules/desktop_capture/rgba_color.h
index ff4a2584152d720e6ecd0fa0bfd50dfa819ac9d1..4908a14011a00e0a24c5b5a98422c616f56dda8a 100644
--- a/webrtc/modules/desktop_capture/rgba_color.h
+++ b/webrtc/modules/desktop_capture/rgba_color.h
@@ -34,12 +34,19 @@ struct RgbaColor final {
// Creates a color from four-byte in BGRA order, i.e. DesktopFrame::data().
explicit RgbaColor(const uint8_t* bgra);
+ // Creates a color from BGRA channels in a uint format. This function creates
+ // an equivalence RgbaColor instance from the ToUInt32() result of another
+ // RgbaColor instance.
+ explicit RgbaColor(uint32_t bgra);
+
// Returns true if |this| and |right| is the same color.
bool operator==(const RgbaColor& right) const;
// Returns true if |this| and |right| are different colors.
bool operator!=(const RgbaColor& right) const;
+ uint32_t ToUInt32() const;
+
uint8_t blue;
uint8_t green;
uint8_t red;

Powered by Google App Engine
This is Rietveld 408576698