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