summaryrefslogtreecommitdiffstats
path: root/remoting/client/frame_consumer.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 23:05:56 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 23:05:56 +0000
commit55d3688e99e891b269cc93c1f695c65a00ea3b48 (patch)
tree31c34f0901866f698d241b7b45a71a2ba6d3cce7 /remoting/client/frame_consumer.h
parent1fd0ff3f0814835c474e527b08c6a2f560246e94 (diff)
downloadchromium_src-55d3688e99e891b269cc93c1f695c65a00ea3b48.zip
chromium_src-55d3688e99e891b269cc93c1f695c65a00ea3b48.tar.gz
chromium_src-55d3688e99e891b269cc93c1f695c65a00ea3b48.tar.bz2
This CL makes several the following improvements to the Chromoting decoder pipeline:
1. Only the clipping area, not the full frame, is drawn. This reduces the risk of out of memory situation on high page zoom levels. Screen updates are also incremental including scrolling scenarios. 2. Decoders now write pixels directly to the Pepper API backing store making it one memcpy less. 3. Scaling and panning is fully controlled by the plugin. The decoder only supplies the pixels it was asked for by the plugin. BUG=109938 Review URL: http://codereview.chromium.org/9331003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/frame_consumer.h')
-rw-r--r--remoting/client/frame_consumer.h60
1 files changed, 26 insertions, 34 deletions
diff --git a/remoting/client/frame_consumer.h b/remoting/client/frame_consumer.h
index de56d81..ce852b4 100644
--- a/remoting/client/frame_consumer.h
+++ b/remoting/client/frame_consumer.h
@@ -5,7 +5,13 @@
#ifndef REMOTING_CLIENT_FRAME_CONSUMER_H_
#define REMOTING_CLIENT_FRAME_CONSUMER_H_
-#include "remoting/base/decoder.h" // For UpdatedRects
+#include "third_party/skia/include/core/SkRect.h"
+#include "third_party/skia/include/core/SkRegion.h"
+#include "third_party/skia/include/core/SkSize.h"
+
+namespace pp {
+class ImageData;
+} // namespace pp
namespace remoting {
@@ -14,40 +20,26 @@ class FrameConsumer {
FrameConsumer() {}
virtual ~FrameConsumer() {}
- // Request a frame be allocated from the FrameConsumer.
- //
- // If a frame cannot be allocated to fit the format, and |size|
- // requirements, |frame_out| will be set to NULL.
- //
- // An allocated frame will have at least the |size| requested, but
- // may be bigger. Query the retrun frame for the actual frame size,
- // stride, etc.
- //
- // The AllocateFrame call is asynchronous. From invocation, until when the
- // |done| callback is invoked, |frame_out| should be considered to be locked
- // by the FrameConsumer, must remain a valid pointer, and should not be
- // examined or modified. After |done| is called, the |frame_out| will
- // contain a result of the allocation. If a frame could not be allocated,
- // |frame_out| will be NULL.
- //
- // All frames retrieved via the AllocateFrame call must be released by a
- // corresponding call ReleaseFrame(scoped_refptr<VideoFrame>* frame_out.
- virtual void AllocateFrame(media::VideoFrame::Format format,
- const SkISize& size,
- scoped_refptr<media::VideoFrame>* frame_out,
- const base::Closure& done) = 0;
-
- virtual void ReleaseFrame(media::VideoFrame* frame) = 0;
-
- // OnPartialFrameOutput() is called every time at least one rectangle of
- // output is produced. The |frame| is guaranteed to have valid data for all
- // of |region|.
+ // Accepts a buffer to be painted to the screen. The buffer's dimensions and
+ // relative position within the frame are specified by |clip_area|. Only
+ // pixels falling within |region| and the current clipping area are painted.
+ // The function assumes that the passed buffer was scaled to fit a window
+ // having |view_size| dimensions.
//
- // Both |frame| and |region| are guaranteed to be valid until the |done|
- // callback is invoked.
- virtual void OnPartialFrameOutput(media::VideoFrame* frame,
- SkRegion* region,
- const base::Closure& done) = 0;
+ // N.B. Both |clip_area| and |region| are in output coordinates relative to
+ // the frame.
+ virtual void ApplyBuffer(const SkISize& view_size,
+ const SkIRect& clip_area,
+ pp::ImageData* buffer,
+ const SkRegion& region) = 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(pp::ImageData* buffer) = 0;
+
+ // Set the dimension of the entire host screen.
+ virtual void SetSourceSize(const SkISize& source_size) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(FrameConsumer);