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

Unified Diff: content/browser/media/capture/cursor_renderer.h

Issue 1412173003: cast: support cursor rendering for tab capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable cursor rendering on windows until resources are available Created 5 years, 1 month 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: content/browser/media/capture/cursor_renderer.h
diff --git a/content/browser/media/capture/cursor_renderer.h b/content/browser/media/capture/cursor_renderer.h
new file mode 100644
index 0000000000000000000000000000000000000000..7416413f421d69c36ab47a21eb4b143976b75489
--- /dev/null
+++ b/content/browser/media/capture/cursor_renderer.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_H_
+#define CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "content/common/content_export.h"
+#include "media/base/video_frame.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace content {
+
+// CursorRenderer is an interface that can be implememented to do cursor
+// rendering on a video frame.
+//
+// In order to track the cursor, the platform-specific implementation
+// will listen to mouse events.
+class CONTENT_EXPORT CursorRenderer {
+ public:
+ virtual ~CursorRenderer() {}
+
+ // Clears the cursor state being tracked. Called when there is a need to
+ // reset the state.
+ virtual void Clear() = 0;
+
+ // Takes a snapshot of the current cursor state and determines whether
+ // the cursor will be rendered, which cursor image to render, and at what
+ // location within |region_in_frame| to render it. Returns true if cursor
+ // needs to be rendered.
+ virtual bool SnapshotCursorState(const gfx::Rect& region_in_frame) = 0;
+
+ // Renders cursor on the |target| video frame.
+ virtual void RenderOnVideoFrame(
+ const scoped_refptr<media::VideoFrame>& target) const = 0;
+
+ // Returns a weak pointer.
+ virtual base::WeakPtr<CursorRenderer> GetWeakPtr() = 0;
+
+ protected:
+ enum {
+ // Minium movement before cursor is rendered on frame.
+ MIN_MOVEMENT_PIXELS = 15,
+ // Maximum idle time allowed before we stop rendering the cursor
+ // on frame.
+ MAX_IDLE_TIME_SECONDS = 2
+ };
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_H_
« no previous file with comments | « content/browser/media/capture/aura_window_capture_machine.cc ('k') | content/browser/media/capture/cursor_renderer_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698