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

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

Issue 2210443002: [WebRTC] Implement Windows ScreenDrawer to test ScreenCapturer* (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Implement ScreenDrawer for X11 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
new file mode 100644
index 0000000000000000000000000000000000000000..594f0dc7c63f47de53ff09e271b89e02c2dc9fad
--- /dev/null
+++ b/webrtc/modules/desktop_capture/screen_drawer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_DESKTOP_CAPTURE_SCREEN_DRAWER_H_
+#define MODULES_DESKTOP_CAPTURE_SCREEN_DRAWER_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#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.
+class ScreenDrawer {
+ public:
+ // Creates a ScreenDrawer for a certain platform.
Sergey Ulanov 2016/08/09 17:43:01 s/a certain/the current/
Hzj_jie 2016/08/11 18:42:03 Done.
+ static std::unique_ptr<ScreenDrawer> Create();
+
+ ScreenDrawer();
+ virtual ~ScreenDrawer();
+
+ // Returns a rect, on which this instance can draw.
+ 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;
+
+ // Clears all content on the screen. In another word, draw a black rectangle
+ // to cover entire DrawableRegion().
+ void Clear() { DrawRectangle(DrawableRegion(), 0); }
Sergey Ulanov 2016/08/09 17:43:01 Thus us an interface, so it shouldn't have any non
Hzj_jie 2016/08/11 18:42:03 Is there any benefit we treat this class as a pure
Sergey Ulanov 2016/08/12 05:49:22 The issue here is not whether we decide to call it
+};
+
+} // namespace webrtc
+
+#endif // MODULES_DESKTOP_CAPTURE_SCREEN_DRAWER_H_

Powered by Google App Engine
This is Rietveld 408576698