| 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 // FrameConsumerProxy is used to allow a FrameConsumer on the UI thread to be | 5 // FrameConsumerProxy is used to allow a FrameConsumer on the UI thread to be |
| 6 // invoked by a Decoder on the decoder thread. The Detach() method is used by | 6 // invoked by a Decoder on the decoder thread. The Detach() method is used by |
| 7 // the proxy's owner before tearing down the FrameConsumer, to prevent any | 7 // the proxy's owner before tearing down the FrameConsumer, to prevent any |
| 8 // further invokations reaching it. | 8 // further invokations reaching it. |
| 9 | 9 |
| 10 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ | 10 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Constructs a proxy for |frame_consumer| which will trampoline invocations | 27 // Constructs a proxy for |frame_consumer| which will trampoline invocations |
| 28 // to |frame_consumer_message_loop|. | 28 // to |frame_consumer_message_loop|. |
| 29 FrameConsumerProxy(scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 29 FrameConsumerProxy(scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 30 | 30 |
| 31 // FrameConsumer implementation. | 31 // FrameConsumer implementation. |
| 32 virtual void ApplyBuffer(const SkISize& view_size, | 32 virtual void ApplyBuffer(const SkISize& view_size, |
| 33 const SkIRect& clip_area, | 33 const SkIRect& clip_area, |
| 34 pp::ImageData* buffer, | 34 pp::ImageData* buffer, |
| 35 const SkRegion& region) OVERRIDE; | 35 const SkRegion& region) OVERRIDE; |
| 36 virtual void ReturnBuffer(pp::ImageData* buffer) OVERRIDE; | 36 virtual void ReturnBuffer(pp::ImageData* buffer) OVERRIDE; |
| 37 virtual void SetSourceSize(const SkISize& source_size) OVERRIDE; | 37 virtual void SetSourceSize(const SkISize& source_size, |
| 38 const SkIPoint& dpi) OVERRIDE; |
| 38 | 39 |
| 39 // Attaches to |frame_consumer_|. | 40 // Attaches to |frame_consumer_|. |
| 40 // This must only be called from |frame_consumer_message_loop_|. | 41 // This must only be called from |frame_consumer_message_loop_|. |
| 41 void Attach(const base::WeakPtr<FrameConsumer>& frame_consumer); | 42 void Attach(const base::WeakPtr<FrameConsumer>& frame_consumer); |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 friend class base::RefCountedThreadSafe<FrameConsumerProxy>; | 45 friend class base::RefCountedThreadSafe<FrameConsumerProxy>; |
| 45 virtual ~FrameConsumerProxy(); | 46 virtual ~FrameConsumerProxy(); |
| 46 | 47 |
| 47 base::WeakPtr<FrameConsumer> frame_consumer_; | 48 base::WeakPtr<FrameConsumer> frame_consumer_; |
| 48 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 49 | 50 |
| 50 DISALLOW_COPY_AND_ASSIGN(FrameConsumerProxy); | 51 DISALLOW_COPY_AND_ASSIGN(FrameConsumerProxy); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 } // namespace remoting | 54 } // namespace remoting |
| 54 | 55 |
| 55 #endif // REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ | 56 #endif // REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ |
| OLD | NEW |