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

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

Issue 2334853002: Use RgbaColor in DesktopFrameGenerator and add RgbaColorTest (Closed)
Patch Set: Resolve review comments 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..1236d03ee67c21c0c13d4c3802a5936ed97ae13a 100644
--- a/webrtc/modules/desktop_capture/rgba_color.h
+++ b/webrtc/modules/desktop_capture/rgba_color.h
@@ -34,12 +34,20 @@ 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. Consumers should make
+ // sure the memory order of the uint32_t is always BGRA from left to right, no
+ // matter the system endian. This function creates an equivalent 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;
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_frame_generator.cc ('k') | webrtc/modules/desktop_capture/rgba_color.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698