| 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_RECTANGLE_UPDATE_DECODER_H_ | 5 #ifndef REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| 6 #define REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 6 #define REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // FrameProducer implementation. These methods may be called before we are | 53 // FrameProducer implementation. These methods may be called before we are |
| 54 // Initialize()d, or we know the source screen size. | 54 // Initialize()d, or we know the source screen size. |
| 55 virtual void DrawBuffer(pp::ImageData* buffer) OVERRIDE; | 55 virtual void DrawBuffer(pp::ImageData* buffer) OVERRIDE; |
| 56 virtual void InvalidateRegion(const SkRegion& region) OVERRIDE; | 56 virtual void InvalidateRegion(const SkRegion& region) OVERRIDE; |
| 57 virtual void RequestReturnBuffers(const base::Closure& done) OVERRIDE; | 57 virtual void RequestReturnBuffers(const base::Closure& done) OVERRIDE; |
| 58 virtual void SetOutputSizeAndClip(const SkISize& view_size, | 58 virtual void SetOutputSizeAndClip(const SkISize& view_size, |
| 59 const SkIRect& clip_area) OVERRIDE; | 59 const SkIRect& clip_area) OVERRIDE; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 friend class base::RefCountedThreadSafe<RectangleUpdateDecoder>; | 62 friend class base::RefCountedThreadSafe<RectangleUpdateDecoder>; |
| 63 | |
| 64 virtual ~RectangleUpdateDecoder(); | 63 virtual ~RectangleUpdateDecoder(); |
| 65 | 64 |
| 66 // Paints the invalidated region to the next available buffer and returns it | 65 // Paints the invalidated region to the next available buffer and returns it |
| 67 // to the consumer. | 66 // to the consumer. |
| 68 void SchedulePaint(); | 67 void SchedulePaint(); |
| 69 void DoPaint(); | 68 void DoPaint(); |
| 70 | 69 |
| 71 scoped_refptr<base::MessageLoopProxy> message_loop_; | 70 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 72 scoped_refptr<FrameConsumerProxy> consumer_; | 71 scoped_refptr<FrameConsumerProxy> consumer_; |
| 73 scoped_ptr<Decoder> decoder_; | 72 scoped_ptr<Decoder> decoder_; |
| 74 | 73 |
| 75 // Remote screen size in pixels. | 74 // Remote screen size in pixels. |
| 76 SkISize source_size_; | 75 SkISize source_size_; |
| 77 | 76 |
| 78 // The current dimentions of the frame consumer view. | 77 // The current dimentions of the frame consumer view. |
| 79 SkISize view_size_; | 78 SkISize view_size_; |
| 80 SkIRect clip_area_; | 79 SkIRect clip_area_; |
| 81 | 80 |
| 82 // The drawing buffers supplied by the frame consumer. | 81 // The drawing buffers supplied by the frame consumer. |
| 83 std::list<pp::ImageData*> buffers_; | 82 std::list<pp::ImageData*> buffers_; |
| 84 | 83 |
| 85 // Flag used to coalesce runs of SchedulePaint()s into a single DoPaint(). | 84 // Flag used to coalesce runs of SchedulePaint()s into a single DoPaint(). |
| 86 bool paint_scheduled_; | 85 bool paint_scheduled_; |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 } // namespace remoting | 88 } // namespace remoting |
| 90 | 89 |
| 91 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ | 90 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H_ |
| OLD | NEW |