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

Side by Side Diff: webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h

Issue 2796673002: Fix crash in XServerPixelBuffer. (Closed)
Patch Set: Created 3 years, 8 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // returns the pointer without doing any more work. The caller must ensure 56 // returns the pointer without doing any more work. The caller must ensure
57 // that |rect| is not larger than window_size(). 57 // that |rect| is not larger than window_size().
58 bool CaptureRect(const DesktopRect& rect, DesktopFrame* frame); 58 bool CaptureRect(const DesktopRect& rect, DesktopFrame* frame);
59 59
60 private: 60 private:
61 void ReleaseSharedMemorySegment(); 61 void ReleaseSharedMemorySegment();
62 62
63 void InitShm(const XWindowAttributes& attributes); 63 void InitShm(const XWindowAttributes& attributes);
64 bool InitPixmaps(int depth); 64 bool InitPixmaps(int depth);
65 65
66 // We expose two forms of blitting to handle variations in the pixel format.
67 // In FastBlit(), the operation is effectively a memcpy.
68 void FastBlit(uint8_t* image,
69 const DesktopRect& rect,
70 DesktopFrame* frame);
71 void SlowBlit(uint8_t* image,
72 const DesktopRect& rect,
73 DesktopFrame* frame);
74
75 Display* display_ = nullptr; 66 Display* display_ = nullptr;
76 Window window_ = 0; 67 Window window_ = 0;
77 DesktopSize window_size_; 68 DesktopSize window_size_;
78 XImage* x_image_ = nullptr; 69 XImage* x_image_ = nullptr;
79 XShmSegmentInfo* shm_segment_info_ = nullptr; 70 XShmSegmentInfo* shm_segment_info_ = nullptr;
71 XImage* x_shm_image_ = nullptr;
80 Pixmap shm_pixmap_ = 0; 72 Pixmap shm_pixmap_ = 0;
81 GC shm_gc_ = nullptr; 73 GC shm_gc_ = nullptr;
82 bool xshm_get_image_succeeded_ = false; 74 bool xshm_get_image_succeeded_ = false;
83 75
84 RTC_DISALLOW_COPY_AND_ASSIGN(XServerPixelBuffer); 76 RTC_DISALLOW_COPY_AND_ASSIGN(XServerPixelBuffer);
85 }; 77 };
86 78
87 } // namespace webrtc 79 } // namespace webrtc
88 80
89 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_X11_X_SERVER_PIXEL_BUFFER_H_ 81 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_X11_X_SERVER_PIXEL_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698