| 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..110fc0a78ed73eeee50f281360028e5bf6cce892
|
| --- /dev/null
|
| +++ b/webrtc/modules/desktop_capture/screen_drawer.h
|
| @@ -0,0 +1,48 @@
|
| +/*
|
| + * 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 the current platform.
|
| + 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. Each platform can have its specific
|
| + // implementation, but a default one is to draw a white rectangle on entire
|
| + // DrawableRegion().
|
| + virtual void Clear();
|
| +};
|
| +
|
| +} // namespace webrtc
|
| +
|
| +#endif // MODULES_DESKTOP_CAPTURE_SCREEN_DRAWER_H_
|
|
|