| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 
| 3  * | 3  * | 
| 4  *  Use of this source code is governed by a BSD-style license | 4  *  Use of this source code is governed by a BSD-style license | 
| 5  *  that can be found in the LICENSE file in the root of the source | 5  *  that can be found in the LICENSE file in the root of the source | 
| 6  *  tree. An additional intellectual property rights grant can be found | 6  *  tree. An additional intellectual property rights grant can be found | 
| 7  *  in the file PATENTS.  All contributing project authors may | 7  *  in the file PATENTS.  All contributing project authors may | 
| 8  *  be found in the AUTHORS file in the root of the source tree. | 8  *  be found in the AUTHORS file in the root of the source tree. | 
| 9  */ | 9  */ | 
| 10 | 10 | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 21                            SharedMemory* shared_memory) | 21                            SharedMemory* shared_memory) | 
| 22     : size_(size), | 22     : size_(size), | 
| 23       stride_(stride), | 23       stride_(stride), | 
| 24       data_(data), | 24       data_(data), | 
| 25       shared_memory_(shared_memory), | 25       shared_memory_(shared_memory), | 
| 26       capture_time_ms_(0) { | 26       capture_time_ms_(0) { | 
| 27 } | 27 } | 
| 28 | 28 | 
| 29 DesktopFrame::~DesktopFrame() {} | 29 DesktopFrame::~DesktopFrame() {} | 
| 30 | 30 | 
|  | 31 const DesktopSize& DesktopFrame::size() const { | 
|  | 32   return size_; | 
|  | 33 } | 
|  | 34 | 
|  | 35 int DesktopFrame::stride() const { | 
|  | 36   return stride_; | 
|  | 37 } | 
|  | 38 | 
|  | 39 uint8_t* DesktopFrame::data() const { | 
|  | 40   return data_; | 
|  | 41 } | 
|  | 42 | 
|  | 43 SharedMemory* DesktopFrame::shared_memory() const { | 
|  | 44   return shared_memory_; | 
|  | 45 } | 
|  | 46 | 
|  | 47 const DesktopRegion& DesktopFrame::updated_region() const { | 
|  | 48   return updated_region_; | 
|  | 49 } | 
|  | 50 | 
|  | 51 DesktopRegion* DesktopFrame::mutable_updated_region() { | 
|  | 52   return &updated_region_; | 
|  | 53 } | 
|  | 54 | 
|  | 55 const DesktopVector& DesktopFrame::dpi() const { | 
|  | 56   return dpi_; | 
|  | 57 } | 
|  | 58 | 
|  | 59 void DesktopFrame::set_dpi(const DesktopVector& dpi) { | 
|  | 60   dpi_ = dpi; | 
|  | 61 } | 
|  | 62 | 
|  | 63 int64_t DesktopFrame::capture_time_ms() const { | 
|  | 64   return capture_time_ms_; | 
|  | 65 } | 
|  | 66 | 
|  | 67 void DesktopFrame::set_capture_time_ms(int64_t time_ms) { | 
|  | 68   capture_time_ms_ = time_ms; | 
|  | 69 } | 
|  | 70 | 
|  | 71 const DesktopRegion* DesktopFrame::shape() const { | 
|  | 72   return shape_.get(); | 
|  | 73 } | 
|  | 74 | 
|  | 75 void DesktopFrame::set_shape(DesktopRegion* shape) { | 
|  | 76   shape_.reset(shape); | 
|  | 77 } | 
|  | 78 | 
| 31 void DesktopFrame::CopyPixelsFrom(uint8_t* src_buffer, int src_stride, | 79 void DesktopFrame::CopyPixelsFrom(uint8_t* src_buffer, int src_stride, | 
| 32                                   const DesktopRect& dest_rect) { | 80                                   const DesktopRect& dest_rect) { | 
| 33   assert(DesktopRect::MakeSize(size()).ContainsRect(dest_rect)); | 81   assert(DesktopRect::MakeSize(size()).ContainsRect(dest_rect)); | 
| 34 | 82 | 
| 35   uint8_t* dest = GetFrameDataAtPos(dest_rect.top_left()); | 83   uint8_t* dest = GetFrameDataAtPos(dest_rect.top_left()); | 
| 36   for (int y = 0; y < dest_rect.height(); ++y) { | 84   for (int y = 0; y < dest_rect.height(); ++y) { | 
| 37     memcpy(dest, src_buffer, DesktopFrame::kBytesPerPixel * dest_rect.width()); | 85     memcpy(dest, src_buffer, DesktopFrame::kBytesPerPixel * dest_rect.width()); | 
| 38     src_buffer += src_stride; | 86     src_buffer += src_stride; | 
| 39     dest += stride(); | 87     dest += stride(); | 
| 40   } | 88   } | 
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 109     : DesktopFrame(size, | 157     : DesktopFrame(size, | 
| 110                    stride, | 158                    stride, | 
| 111                    reinterpret_cast<uint8_t*>(shared_memory->data()), | 159                    reinterpret_cast<uint8_t*>(shared_memory->data()), | 
| 112                    shared_memory.release()) {} | 160                    shared_memory.release()) {} | 
| 113 | 161 | 
| 114 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() { | 162 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() { | 
| 115   delete shared_memory_; | 163   delete shared_memory_; | 
| 116 } | 164 } | 
| 117 | 165 | 
| 118 }  // namespace webrtc | 166 }  // namespace webrtc | 
| OLD | NEW | 
|---|