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

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

Issue 2268093002: [WebRTC] A real ScreenCapturer test (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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/screen_drawer.h
diff --git a/webrtc/modules/desktop_capture/screen_drawer.h b/webrtc/modules/desktop_capture/screen_drawer.h
index 899fc0f043b841f310ec1a2ae3f09f43875cc996..0ee243142ebddddacfb592f784e627de6b696040 100644
--- a/webrtc/modules/desktop_capture/screen_drawer.h
+++ b/webrtc/modules/desktop_capture/screen_drawer.h
@@ -19,26 +19,39 @@
namespace webrtc {
-// A set of platform independent functions to draw various of shapes on the
-// screen. This class is for testing ScreenCapturer* implementations only, and
+// A set of basic platform dependent functions to draw various shapes on the
+// screen.
+// Usually ScreenPainter is preferred, instead of using this class directly. As
+// ScreenPainter provides more complex shapes by using ScreenDrawer for each
+// platform. This class is for testing ScreenCapturer* implementations only, and
// should not be used in production logic.
class ScreenDrawer {
public:
- // Creates a ScreenDrawer for the current platform.
+ // Creates a ScreenDrawer for the current platform, returns nullptr if no
+ // ScreenDrawer implementation available.
static std::unique_ptr<ScreenDrawer> Create();
ScreenDrawer() {}
virtual ~ScreenDrawer() {}
- // Returns a rect, on which this instance can draw.
+ // Returns a rectangle, on which this instance can draw. Note, this rectangle
+ // does not need to map to a physical monitor or a logic screen. ScreenDrawer
+ // does not guarantee drawing a point at (0, 0) means the point will be placed
+ // at (0, 0) of a monitor or a logic screen. But it guarantees points drawing
+ // at (0, 0) will eventually show up, top-left part of the drawable region
+ // should not be covered by another window, or out of display area. Refer to
+ // CalibrateScreenDrawerPosition() function in screen_capturer_unittest.cc to
+ // see how to calibrate the visible region of a ScreenDrawer.
virtual DesktopRect DrawableRegion() = 0;
- // Draws a rectangle to cover |rect| with color |rgba|. Note, rect.bottom()
+ // Draws a rectangle to cover |rect| with color |bgra|. Note, rect.bottom()
// and rect.right() two lines are not included.
- virtual void DrawRectangle(DesktopRect rect, uint32_t rgba) = 0;
+ virtual void DrawRectangle(DesktopRect rect, uint32_t bgra) = 0;
- // Clears all content on the screen.
- virtual void Clear() = 0;
+ // Blocks current thread until OS finishes previous Draw* actions.
+ // ScreenCapturer should be able to capture the changes after this function
+ // finish.
+ virtual void WaitForPendingPaintings() = 0;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698