Chromium Code Reviews| Index: webrtc/modules/desktop_capture/desktop_frame.h |
| diff --git a/webrtc/modules/desktop_capture/desktop_frame.h b/webrtc/modules/desktop_capture/desktop_frame.h |
| index d491135029fe45f79940e81d1c042961ef0ab7cf..1d4df0e40492a343dec1832336f488948c80144c 100644 |
| --- a/webrtc/modules/desktop_capture/desktop_frame.h |
| +++ b/webrtc/modules/desktop_capture/desktop_frame.h |
| @@ -16,6 +16,7 @@ |
| #include "webrtc/base/constructormagic.h" |
| #include "webrtc/modules/desktop_capture/desktop_geometry.h" |
| #include "webrtc/modules/desktop_capture/desktop_region.h" |
| +#include "webrtc/modules/desktop_capture/rgba_color.h" |
| #include "webrtc/modules/desktop_capture/shared_memory.h" |
| #include "webrtc/typedefs.h" |
| @@ -26,6 +27,9 @@ class DesktopFrame { |
| public: |
| // DesktopFrame objects always hold RGBA data. |
| static const int kBytesPerPixel = 4; |
| + static_assert(kBytesPerPixel == sizeof(RgbaColor), |
| + "A pixel in DesktopFrame should be safe to be represented by a " |
| + "RgbaColor"); |
| virtual ~DesktopFrame(); |
| @@ -68,6 +72,18 @@ class DesktopFrame { |
| // A helper to return the data pointer of a frame at the specified position. |
| uint8_t* GetFrameDataAtPos(const DesktopVector& pos) const; |
| + // Whether current instance equals to the |other| in both size() and data(). |
| + bool DataEquals(const DesktopFrame& other) const; |
| + |
| + // Paints the pixel at |pos| with |color|. This should be for test purpose |
| + // only. This function triggers check failure if pos is out of current |
| + // DesktopFrame. |
| + void Paint(DesktopVector pos, RgbaColor color); |
|
Sergey Ulanov
2016/11/15 02:28:10
Do we really need this function here? RgbaColor is
Hzj_jie
2016/11/15 05:17:02
Sure. Updated.
|
| + |
| + // Clears DesktopFrame by set entire data() buffer into 0. This should be for |
| + // test purpose only. |
| + void Clear(); |
| + |
| protected: |
| DesktopFrame(DesktopSize size, |
| int stride, |