summaryrefslogtreecommitdiffstats
path: root/remoting/client/frame_consumer.h
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2015-08-19 19:02:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-20 02:02:56 +0000
commit13bca69cfa261ec8eb6bffecf59c486b683eb8db (patch)
tree2a6c5c5217c4e148ff4c2e94c0e48a2cc2997014 /remoting/client/frame_consumer.h
parent7a402ba51bf75c883cde14c8bd83fa082f685c08 (diff)
downloadchromium_src-13bca69cfa261ec8eb6bffecf59c486b683eb8db.zip
chromium_src-13bca69cfa261ec8eb6bffecf59c486b683eb8db.tar.gz
chromium_src-13bca69cfa261ec8eb6bffecf59c486b683eb8db.tar.bz2
remoting: Simplify FrameConsumer interface and remove FrameProducer interface.
Now FrameConsumer implementation is responsible for scaling. This makes interaction with FrameConsumer much simpler. Also removed FrameProducer interface as it's no longer needed. Currently video scaling is only used in the plugin when Graphics3D is not available. In that case Graphics2D::SetScale() performs better than trying to scale the image in the plugin, especially given that the scaling code is not optimized for PNaCl. This refactoring also allowed to simplify threading logic in the rendering both on Android and in the plugin. BUG=256850, 486917, 509914 Review URL: https://codereview.chromium.org/1288063004 Cr-Commit-Position: refs/heads/master@{#344404}
Diffstat (limited to 'remoting/client/frame_consumer.h')
-rw-r--r--remoting/client/frame_consumer.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/remoting/client/frame_consumer.h b/remoting/client/frame_consumer.h
index ab6f16e..f320356 100644
--- a/remoting/client/frame_consumer.h
+++ b/remoting/client/frame_consumer.h
@@ -19,36 +19,17 @@ namespace remoting {
class FrameConsumer {
public:
-
// List of supported pixel formats needed by various platforms.
enum PixelFormat {
FORMAT_BGRA, // Used by the Pepper plugin.
FORMAT_RGBA, // Used for Android's Bitmap class.
};
- // Paints the contents of |buffer| into the area of the view identified
- // by |clip_area|. |view_size| specifies the full-frame dimensions to which
- // the |buffer|/|clip_area| portion was scaled. Implementations may be
- // optimized to only paint pixels within the intersection of |region| and
- // |clip_area|. If |shape| is non-NULL then it specifies the complete shape
- // of the frame, otherwise the frame is un-shaped.
- //
- // N.B. |clip_area|, |region| and |shape| should be provided in output view
- // coordinates.
- virtual void ApplyBuffer(const webrtc::DesktopSize& view_size,
- const webrtc::DesktopRect& clip_area,
- webrtc::DesktopFrame* buffer,
- const webrtc::DesktopRegion& region,
- const webrtc::DesktopRegion* shape) = 0;
-
- // Accepts a buffer that couldn't be used for drawing for any reason (shutdown
- // is in progress, the view area has changed, etc.). The accepted buffer can
- // be freed or reused for another drawing operation.
- virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) = 0;
+ virtual scoped_ptr<webrtc::DesktopFrame> AllocateFrame(
+ const webrtc::DesktopSize& size) = 0;
- // Set the dimension of the entire host screen.
- virtual void SetSourceSize(const webrtc::DesktopSize& source_size,
- const webrtc::DesktopVector& dpi) = 0;
+ virtual void DrawFrame(scoped_ptr<webrtc::DesktopFrame> frame,
+ const base::Closure& done) = 0;
// Returns the preferred pixel encoding for the platform.
virtual PixelFormat GetPixelFormat() = 0;