Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: webrtc/modules/desktop_capture/desktop_frame.cc

Issue 2350743003: Bug Fix: Mac Retina Screen Capture's Mouse Cursor Too Small (Closed)
Patch Set: No round Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 SharedMemory* shared_memory) 24 SharedMemory* shared_memory)
25 : data_(data), 25 : data_(data),
26 shared_memory_(shared_memory), 26 shared_memory_(shared_memory),
27 size_(size), 27 size_(size),
28 stride_(stride), 28 stride_(stride),
29 capture_time_ms_(0) { 29 capture_time_ms_(0) {
30 } 30 }
31 31
32 DesktopFrame::~DesktopFrame() {} 32 DesktopFrame::~DesktopFrame() {}
33 33
34 void DesktopFrame::CopyPixelsFrom(uint8_t* src_buffer, int src_stride, 34 void DesktopFrame::CopyPixelsFrom(const uint8_t* src_buffer, int src_stride,
35 const DesktopRect& dest_rect) { 35 const DesktopRect& dest_rect) {
36 RTC_CHECK(DesktopRect::MakeSize(size()).ContainsRect(dest_rect)); 36 RTC_CHECK(DesktopRect::MakeSize(size()).ContainsRect(dest_rect));
37 37
38 uint8_t* dest = GetFrameDataAtPos(dest_rect.top_left()); 38 uint8_t* dest = GetFrameDataAtPos(dest_rect.top_left());
39 for (int y = 0; y < dest_rect.height(); ++y) { 39 for (int y = 0; y < dest_rect.height(); ++y) {
40 memcpy(dest, src_buffer, DesktopFrame::kBytesPerPixel * dest_rect.width()); 40 memcpy(dest, src_buffer, DesktopFrame::kBytesPerPixel * dest_rect.width());
41 src_buffer += src_stride; 41 src_buffer += src_stride;
42 dest += stride(); 42 dest += stride();
43 } 43 }
44 } 44 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 : DesktopFrame(size, 109 : DesktopFrame(size,
110 stride, 110 stride,
111 reinterpret_cast<uint8_t*>(shared_memory->data()), 111 reinterpret_cast<uint8_t*>(shared_memory->data()),
112 shared_memory) {} 112 shared_memory) {}
113 113
114 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() { 114 SharedMemoryDesktopFrame::~SharedMemoryDesktopFrame() {
115 delete shared_memory_; 115 delete shared_memory_;
116 } 116 }
117 117
118 } // namespace webrtc 118 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_frame.h ('k') | webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698