OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CLIENT_FRAME_PRODUCER_H_ | 5 #ifndef REMOTING_CLIENT_FRAME_PRODUCER_H_ |
6 #define REMOTING_CLIENT_FRAME_PRODUCER_H_ | 6 #define REMOTING_CLIENT_FRAME_PRODUCER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "third_party/skia/include/core/SkRect.h" | 9 #include "third_party/skia/include/core/SkRect.h" |
10 #include "third_party/skia/include/core/SkRegion.h" | 10 #include "third_party/skia/include/core/SkRegion.h" |
11 #include "third_party/skia/include/core/SkSize.h" | 11 #include "third_party/skia/include/core/SkSize.h" |
12 | 12 |
13 namespace pp { | 13 namespace pp { |
14 class ImageData; | 14 class ImageData; |
15 } // namespace pp | 15 } // namespace pp |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 | 18 |
19 class FrameProducer { | 19 class FrameProducer { |
20 public: | 20 public: |
21 FrameProducer() {} | 21 FrameProducer() {} |
22 virtual ~FrameProducer() {} | |
23 | 22 |
24 // Adds an image buffer to the pool of pending buffers for subsequent drawing. | 23 // Adds an image buffer to the pool of pending buffers for subsequent drawing. |
25 // Once drawing is completed the buffer will be returned to the consumer via | 24 // Once drawing is completed the buffer will be returned to the consumer via |
26 // the FrameConsumer::ApplyBuffer() call. Alternatively an empty buffer could | 25 // the FrameConsumer::ApplyBuffer() call. Alternatively an empty buffer could |
27 // be returned via the FrameConsumer::ReturnBuffer() call. | 26 // be returned via the FrameConsumer::ReturnBuffer() call. |
28 // | 27 // |
29 // The passed buffer must be large enough to hold the whole clipping area. | 28 // The passed buffer must be large enough to hold the whole clipping area. |
30 virtual void DrawBuffer(pp::ImageData* buffer) = 0; | 29 virtual void DrawBuffer(pp::ImageData* buffer) = 0; |
31 | 30 |
32 // Requests repainting of the specified |region| of the frame as soon as | 31 // Requests repainting of the specified |region| of the frame as soon as |
33 // possible. |region| is specified in output coordinates relative to | 32 // possible. |region| is specified in output coordinates relative to |
34 // the beginning of the frame. | 33 // the beginning of the frame. |
35 virtual void InvalidateRegion(const SkRegion& region) = 0; | 34 virtual void InvalidateRegion(const SkRegion& region) = 0; |
36 | 35 |
37 // Requests returing of all pending buffers to the consumer via | 36 // Requests returing of all pending buffers to the consumer via |
38 // FrameConsumer::ReturnBuffer() calls. | 37 // FrameConsumer::ReturnBuffer() calls. |
39 virtual void RequestReturnBuffers(const base::Closure& done) = 0; | 38 virtual void RequestReturnBuffers(const base::Closure& done) = 0; |
40 | 39 |
41 // Notifies the producer of changes to the output view size or clipping area. | 40 // Notifies the producer of changes to the output view size or clipping area. |
42 // Implementations must cope with empty |view_size| or |clip_area|. | 41 // Implementations must cope with empty |view_size| or |clip_area|. |
43 virtual void SetOutputSizeAndClip(const SkISize& view_size, | 42 virtual void SetOutputSizeAndClip(const SkISize& view_size, |
44 const SkIRect& clip_area) = 0; | 43 const SkIRect& clip_area) = 0; |
45 | 44 |
| 45 protected: |
| 46 virtual ~FrameProducer() {} |
| 47 |
46 private: | 48 private: |
47 DISALLOW_COPY_AND_ASSIGN(FrameProducer); | 49 DISALLOW_COPY_AND_ASSIGN(FrameProducer); |
48 }; | 50 }; |
49 | 51 |
50 } // namespace remoting | 52 } // namespace remoting |
51 | 53 |
52 #endif // REMOTING_CLIENT_FRAME_PRODUCER_H_ | 54 #endif // REMOTING_CLIENT_FRAME_PRODUCER_H_ |
OLD | NEW |