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

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: Resolve review comments 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..955c3007839c1f09a345bb4e7104f0d02676e2cf 100644
--- a/webrtc/modules/desktop_capture/screen_drawer.h
+++ b/webrtc/modules/desktop_capture/screen_drawer.h
@@ -15,30 +15,40 @@
#include <memory>
+#include "webrtc/modules/desktop_capture/color.h"
#include "webrtc/modules/desktop_capture/desktop_geometry.h"
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
-// should not be used in production logic.
+// A set of basic platform dependent functions to draw various shapes on the
+// screen.
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 the region inside which DrawRectangle() function are expected to
+ // work, in capturer coordinates (assuming ScreenCapturer::SelectScreen has
+ // not been called). This region may excludes regions of the screen reserved
+ // by the OS for things like menu bars or app launchers.
virtual DesktopRect DrawableRegion() = 0;
- // Draws a rectangle to cover |rect| with color |rgba|. Note, rect.bottom()
- // and rect.right() two lines are not included.
- virtual void DrawRectangle(DesktopRect rect, uint32_t rgba) = 0;
+ // Draws a rectangle to cover |rect| with |color|. Note, rect.bottom() and
+ // rect.right() two lines are not included. The part of |rect| which is out of
+ // DrawableRegion() will be ignored.
+ virtual void DrawRectangle(DesktopRect rect, Color color) = 0;
- // Clears all content on the screen.
+ // Clears all content on the screen by filling the area with black.
virtual void Clear() = 0;
+
+ // Blocks current thread until OS finishes previous DrawRectangle() actions.
+ // ScreenCapturer should be able to capture the changes after this function
+ // finish.
+ virtual void WaitForPendingDraws() = 0;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698