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 #include "remoting/client/frame_consumer_proxy.h" | 5 #include "remoting/client/frame_consumer_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "ppapi/cpp/image_data.h" | 10 #include "ppapi/cpp/image_data.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 if (!task_runner_->BelongsToCurrentThread()) { | 35 if (!task_runner_->BelongsToCurrentThread()) { |
36 task_runner_->PostTask(FROM_HERE, base::Bind( | 36 task_runner_->PostTask(FROM_HERE, base::Bind( |
37 &FrameConsumerProxy::ReturnBuffer, this, buffer)); | 37 &FrameConsumerProxy::ReturnBuffer, this, buffer)); |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 if (frame_consumer_) | 41 if (frame_consumer_) |
42 frame_consumer_->ReturnBuffer(buffer); | 42 frame_consumer_->ReturnBuffer(buffer); |
43 } | 43 } |
44 | 44 |
45 void FrameConsumerProxy::SetSourceSize(const SkISize& source_size) { | 45 void FrameConsumerProxy::SetSourceSize(const SkISize& source_size, |
| 46 const SkIPoint& source_dpi) { |
46 if (!task_runner_->BelongsToCurrentThread()) { | 47 if (!task_runner_->BelongsToCurrentThread()) { |
47 task_runner_->PostTask(FROM_HERE, base::Bind( | 48 task_runner_->PostTask(FROM_HERE, base::Bind( |
48 &FrameConsumerProxy::SetSourceSize, this, source_size)); | 49 &FrameConsumerProxy::SetSourceSize, this, source_size, source_dpi)); |
49 return; | 50 return; |
50 } | 51 } |
51 | 52 |
52 if (frame_consumer_) | 53 if (frame_consumer_) |
53 frame_consumer_->SetSourceSize(source_size); | 54 frame_consumer_->SetSourceSize(source_size, source_dpi); |
54 } | 55 } |
55 | 56 |
56 void FrameConsumerProxy::Attach( | 57 void FrameConsumerProxy::Attach( |
57 const base::WeakPtr<FrameConsumer>& frame_consumer) { | 58 const base::WeakPtr<FrameConsumer>& frame_consumer) { |
58 DCHECK(task_runner_->BelongsToCurrentThread()); | 59 DCHECK(task_runner_->BelongsToCurrentThread()); |
59 DCHECK(frame_consumer_ == NULL); | 60 DCHECK(frame_consumer_ == NULL); |
60 frame_consumer_ = frame_consumer; | 61 frame_consumer_ = frame_consumer; |
61 } | 62 } |
62 | 63 |
63 FrameConsumerProxy::~FrameConsumerProxy() { | 64 FrameConsumerProxy::~FrameConsumerProxy() { |
64 } | 65 } |
65 | 66 |
66 } // namespace remoting | 67 } // namespace remoting |
OLD | NEW |