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

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

Issue 2337073007: Deflaky ScreenCapturerTest (Closed)
Patch Set: Resolve review comments Created 4 years, 2 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 d7ec5d186cb7896cb9a16336289b27eb33d1467b..430182dec36352a61e9be476ff480245d842cd7d 100644
--- a/webrtc/modules/desktop_capture/screen_drawer.h
+++ b/webrtc/modules/desktop_capture/screen_drawer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ * Copyright 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
@@ -20,16 +20,31 @@
namespace webrtc {
+// A cross application lock to ensure only one ScreenDrawer can be used at a
Sergey Ulanov 2016/10/18 03:26:56 s/cross application/cross-process/
Hzj_jie 2016/10/19 00:46:47 Done.
+// certain time.
+class ScreenDrawerLock {
+ public:
+ virtual ~ScreenDrawerLock();
+
+ static std::unique_ptr<ScreenDrawerLock> Create();
+
+ protected:
+ ScreenDrawerLock();
+};
+
// A set of basic platform dependent functions to draw various shapes on the
// screen.
class ScreenDrawer {
public:
// Creates a ScreenDrawer for the current platform, returns nullptr if no
// ScreenDrawer implementation available.
+ // If the implementation cannot guarantee two ScreenDrawer instances won't
+ // impact each other, this function may block current thread until another
+ // ScreenDrawer has been destroyed.
static std::unique_ptr<ScreenDrawer> Create();
- ScreenDrawer() {}
- virtual ~ScreenDrawer() {}
+ ScreenDrawer();
+ virtual ~ScreenDrawer();
// Returns the region inside which DrawRectangle() function are expected to
// work, in capturer coordinates (assuming ScreenCapturer::SelectScreen has
@@ -49,6 +64,12 @@ class ScreenDrawer {
// ScreenCapturer should be able to capture the changes after this function
// finish.
virtual void WaitForPendingDraws() = 0;
+
+ // Returns true if incomplete shapes previous actions required may be drawn on
+ // the screen after a WaitForPendingDraws() call. i.e. Though the complete
+ // shapes will eventually be drawn on the screen, due to some OS limitations,
+ // these shapes may be partially appeared sometimes.
+ virtual bool MayDrawIncompleteShapes() = 0;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698