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

Unified Diff: remoting/client/frame_producer.h

Issue 9331003: Improving the decoder pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 10 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: remoting/client/frame_producer.h
diff --git a/remoting/client/frame_producer.h b/remoting/client/frame_producer.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa8e0a85f46582505d31e966bbff676e874a5016
--- /dev/null
+++ b/remoting/client/frame_producer.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 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 REMOTING_CLIENT_FRAME_PRODUCER_H_
+#define REMOTING_CLIENT_FRAME_PRODUCER_H_
+
+#include "base/callback_forward.h"
+#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 {
+
+class FrameProducer {
+ public:
+ FrameProducer() {}
+ virtual ~FrameProducer() {}
+
+ // This routine drains the queue returning all pending buffers to
+ // the consumer.
Wez 2012/02/17 23:42:17 nit: "Request that all pending buffers be returned
alexeypa (please no reviews) 2012/02/21 23:00:44 Done.
+ virtual void DrainQueue(const base::Closure& done) = 0;
+
+ // This routine submits an image buffer for subsequent drawing. Once any part
+ // of the frame within the clipping area is invalidated, the producer copies
+ // the updated pixels to one of the pending buffers and return it to
+ // the consumer via the FrameConsumer::PaintBuffer() call.
+ //
+ // The passed buffer must be large enough to hold the whole clipping area.
Wez 2012/02/17 23:42:17 I think this method needs a better name, and descr
alexeypa (please no reviews) 2012/02/21 23:00:44 AddBuffer() because no user method calls these buf
Wez 2012/02/23 00:11:09 Wouldn't DrawBuffer be more appropriate, then, sin
alexeypa (please no reviews) 2012/02/23 17:10:33 FrameProducer::AddBuffer -> FrameProducer::DrawBuf
+ virtual void EnqueueBuffer(pp::ImageData* buffer) = 0;
+
+ // The frame consumer can call this routine requesting the frame to be
+ // repainted. The specified region of the frame is will be invalided.
+ // The region is given in client's coordinates relative to the beginning of
+ // the frame.
Wez 2012/02/17 23:42:17 nit: Comment style, e.g: "Requests that the speci
alexeypa (please no reviews) 2012/02/21 23:00:44 Done.
+ virtual void Invalidate(const SkRegion& region) = 0;
Wez 2012/02/17 23:42:17 Consider calling this RequestRegion() or Invalidat
alexeypa (please no reviews) 2012/02/21 23:00:44 Done.
+
+ // The frame consumer calls this function to notify the producer about view
+ // area changes. This can result in producer immediately returning some of or
+ // all enqueued buffers to the consumer for reuse or reallocation.
Wez 2012/02/17 23:42:17 nit: Comment style, e.g: "Notifies the producer o
alexeypa (please no reviews) 2012/02/21 23:00:44 Done.
+ virtual void SetView(const SkISize& view_size, const SkIRect& clip_area) = 0;
Wez 2012/02/17 23:42:17 "View" is a Pepper term; in abstract terms this se
alexeypa (please no reviews) 2012/02/21 23:00:44 It should be SetScalingFactorAndClipArea() then. I
Wez 2012/02/23 00:11:09 The API doesn't take a scaling factor, it takes an
alexeypa (please no reviews) 2012/02/23 17:10:33 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FrameProducer);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_FRAME_PRODUCER_H_

Powered by Google App Engine
This is Rietveld 408576698