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/plugin/pepper_view.h" | 5 #include "remoting/client/plugin/pepper_view.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (source_size_ == source_size && source_dpi_ == source_dpi) | 205 if (source_size_ == source_size && source_dpi_ == source_dpi) |
206 return; | 206 return; |
207 | 207 |
208 source_size_ = source_size; | 208 source_size_ = source_size; |
209 source_dpi_ = source_dpi; | 209 source_dpi_ = source_dpi; |
210 | 210 |
211 // Notify JavaScript of the change in source size. | 211 // Notify JavaScript of the change in source size. |
212 instance_->SetDesktopSize(source_size, source_dpi); | 212 instance_->SetDesktopSize(source_size, source_dpi); |
213 } | 213 } |
214 | 214 |
| 215 FrameConsumer::PixelFormat PepperView::GetPixelFormat() { |
| 216 return FORMAT_BGRA; |
| 217 } |
| 218 |
215 webrtc::DesktopFrame* PepperView::AllocateBuffer() { | 219 webrtc::DesktopFrame* PepperView::AllocateBuffer() { |
216 if (buffers_.size() >= kMaxPendingBuffersCount) | 220 if (buffers_.size() >= kMaxPendingBuffersCount) |
217 return NULL; | 221 return NULL; |
218 | 222 |
219 if (clip_area_.width()==0 || clip_area_.height()==0) | 223 if (clip_area_.width()==0 || clip_area_.height()==0) |
220 return NULL; | 224 return NULL; |
221 | 225 |
222 // Create an image buffer of the required size, but don't zero it. | 226 // Create an image buffer of the required size, but don't zero it. |
223 pp::ImageData buffer_data(instance_, | 227 pp::ImageData buffer_data(instance_, |
224 PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 228 PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 331 |
328 // If there is a buffer queued for rendering then render it now. | 332 // If there is a buffer queued for rendering then render it now. |
329 if (merge_buffer_ != NULL) { | 333 if (merge_buffer_ != NULL) { |
330 buffer = merge_buffer_; | 334 buffer = merge_buffer_; |
331 merge_buffer_ = NULL; | 335 merge_buffer_ = NULL; |
332 FlushBuffer(merge_clip_area_, buffer, merge_region_); | 336 FlushBuffer(merge_clip_area_, buffer, merge_region_); |
333 } | 337 } |
334 } | 338 } |
335 | 339 |
336 } // namespace remoting | 340 } // namespace remoting |
OLD | NEW |