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_CONSUMER_H_ | 5 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_H_ |
6 #define REMOTING_CLIENT_FRAME_CONSUMER_H_ | 6 #define REMOTING_CLIENT_FRAME_CONSUMER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "third_party/skia/include/core/SkRect.h" | |
10 #include "third_party/skia/include/core/SkRegion.h" | |
11 #include "third_party/skia/include/core/SkSize.h" | |
12 | 9 |
13 namespace webrtc { | 10 namespace webrtc { |
14 class DesktopFrame; | 11 class DesktopFrame; |
| 12 class DesktopRect; |
| 13 class DesktopRegion; |
| 14 class DesktopSize; |
| 15 class DesktopVector; |
15 } // namespace webrtc | 16 } // namespace webrtc |
16 | 17 |
17 namespace remoting { | 18 namespace remoting { |
18 | 19 |
19 class FrameConsumer { | 20 class FrameConsumer { |
20 public: | 21 public: |
21 // Accepts a buffer to be painted to the screen. The buffer's dimensions and | 22 // Accepts a buffer to be painted to the screen. The buffer's dimensions and |
22 // relative position within the frame are specified by |clip_area|. Only | 23 // relative position within the frame are specified by |clip_area|. Only |
23 // pixels falling within |region| and the current clipping area are painted. | 24 // pixels falling within |region| and the current clipping area are painted. |
24 // The function assumes that the passed buffer was scaled to fit a window | 25 // The function assumes that the passed buffer was scaled to fit a window |
25 // having |view_size| dimensions. | 26 // having |view_size| dimensions. |
26 // | 27 // |
27 // N.B. Both |clip_area| and |region| are in output coordinates relative to | 28 // N.B. Both |clip_area| and |region| are in output coordinates relative to |
28 // the frame. | 29 // the frame. |
29 virtual void ApplyBuffer(const SkISize& view_size, | 30 virtual void ApplyBuffer(const webrtc::DesktopSize& view_size, |
30 const SkIRect& clip_area, | 31 const webrtc::DesktopRect& clip_area, |
31 webrtc::DesktopFrame* buffer, | 32 webrtc::DesktopFrame* buffer, |
32 const SkRegion& region) = 0; | 33 const webrtc::DesktopRegion& region) = 0; |
33 | 34 |
34 // Accepts a buffer that couldn't be used for drawing for any reason (shutdown | 35 // Accepts a buffer that couldn't be used for drawing for any reason (shutdown |
35 // is in progress, the view area has changed, etc.). The accepted buffer can | 36 // is in progress, the view area has changed, etc.). The accepted buffer can |
36 // be freed or reused for another drawing operation. | 37 // be freed or reused for another drawing operation. |
37 virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) = 0; | 38 virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) = 0; |
38 | 39 |
39 // Set the dimension of the entire host screen. | 40 // Set the dimension of the entire host screen. |
40 virtual void SetSourceSize(const SkISize& source_size, | 41 virtual void SetSourceSize(const webrtc::DesktopSize& source_size, |
41 const SkIPoint& dpi) = 0; | 42 const webrtc::DesktopVector& dpi) = 0; |
42 | 43 |
43 protected: | 44 protected: |
44 FrameConsumer() {} | 45 FrameConsumer() {} |
45 virtual ~FrameConsumer() {} | 46 virtual ~FrameConsumer() {} |
46 | 47 |
47 private: | 48 private: |
48 DISALLOW_COPY_AND_ASSIGN(FrameConsumer); | 49 DISALLOW_COPY_AND_ASSIGN(FrameConsumer); |
49 }; | 50 }; |
50 | 51 |
51 } // namespace remoting | 52 } // namespace remoting |
52 | 53 |
53 #endif // REMOTING_CLIENT_FRAME_CONSUMER_H_ | 54 #endif // REMOTING_CLIENT_FRAME_CONSUMER_H_ |
OLD | NEW |