| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (source_size_.equals(source_size) && source_dpi_.equals(source_dpi)) | 198 if (source_size_.equals(source_size) && source_dpi_.equals(source_dpi)) |
| 199 return; | 199 return; |
| 200 | 200 |
| 201 source_size_ = source_size; | 201 source_size_ = source_size; |
| 202 source_dpi_ = source_dpi; | 202 source_dpi_ = source_dpi; |
| 203 | 203 |
| 204 // Notify JavaScript of the change in source size. | 204 // Notify JavaScript of the change in source size. |
| 205 instance_->SetDesktopSize(source_size, source_dpi); | 205 instance_->SetDesktopSize(source_size, source_dpi); |
| 206 } | 206 } |
| 207 | 207 |
| 208 FrameConsumer::PixelFormat PepperView::GetPixelFormat() { |
| 209 return FORMAT_BGRA; |
| 210 } |
| 211 |
| 208 webrtc::DesktopFrame* PepperView::AllocateBuffer() { | 212 webrtc::DesktopFrame* PepperView::AllocateBuffer() { |
| 209 if (buffers_.size() >= kMaxPendingBuffersCount) | 213 if (buffers_.size() >= kMaxPendingBuffersCount) |
| 210 return NULL; | 214 return NULL; |
| 211 | 215 |
| 212 if (clip_area_.width()==0 || clip_area_.height()==0) | 216 if (clip_area_.width()==0 || clip_area_.height()==0) |
| 213 return NULL; | 217 return NULL; |
| 214 | 218 |
| 215 // Create an image buffer of the required size, but don't zero it. | 219 // Create an image buffer of the required size, but don't zero it. |
| 216 pp::ImageData buffer_data(instance_, | 220 pp::ImageData buffer_data(instance_, |
| 217 PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 221 PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 325 |
| 322 // If there is a buffer queued for rendering then render it now. | 326 // If there is a buffer queued for rendering then render it now. |
| 323 if (merge_buffer_ != NULL) { | 327 if (merge_buffer_ != NULL) { |
| 324 buffer = merge_buffer_; | 328 buffer = merge_buffer_; |
| 325 merge_buffer_ = NULL; | 329 merge_buffer_ = NULL; |
| 326 FlushBuffer(merge_clip_area_, buffer, merge_region_); | 330 FlushBuffer(merge_clip_area_, buffer, merge_region_); |
| 327 } | 331 } |
| 328 } | 332 } |
| 329 | 333 |
| 330 } // namespace remoting | 334 } // namespace remoting |
| OLD | NEW |