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

Side by Side Diff: remoting/host/capturer_mac.cc

Issue 2840036: Moving Encoder and Decoder to remoting/base (Closed)
Patch Set: fix DEPS Created 10 years, 5 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
« no previous file with comments | « remoting/host/capturer_gdi.cc ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/host/capturer_mac.h" 5 #include "remoting/host/capturer_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <OpenGL/CGLMacro.h> 9 #include <OpenGL/CGLMacro.h>
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 glPixelStorei(GL_PACK_ALIGNMENT, 4); // Force 4-byte alignment. 86 glPixelStorei(GL_PACK_ALIGNMENT, 4); // Force 4-byte alignment.
87 glPixelStorei(GL_PACK_ROW_LENGTH, 0); 87 glPixelStorei(GL_PACK_ROW_LENGTH, 0);
88 glPixelStorei(GL_PACK_SKIP_ROWS, 0); 88 glPixelStorei(GL_PACK_SKIP_ROWS, 0);
89 glPixelStorei(GL_PACK_SKIP_PIXELS, 0); 89 glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
90 90
91 // Read a block of pixels from the frame buffer. 91 // Read a block of pixels from the frame buffer.
92 glReadPixels(0, 0, width(), height(), GL_BGRA, GL_UNSIGNED_BYTE, 92 glReadPixels(0, 0, width(), height(), GL_BGRA, GL_UNSIGNED_BYTE,
93 buffers_[current_buffer_].get()); 93 buffers_[current_buffer_].get());
94 glPopClientAttrib(); 94 glPopClientAttrib();
95 95
96 Capturer::DataPlanes planes; 96 DataPlanes planes;
97 planes.data[0] = buffers_[current_buffer_].get(); 97 planes.data[0] = buffers_[current_buffer_].get();
98 planes.strides[0] = bytes_per_row_; 98 planes.strides[0] = bytes_per_row_;
99 99
100 scoped_refptr<CaptureData> data(new CaptureData(planes, 100 scoped_refptr<CaptureData> data(new CaptureData(planes,
101 width(), 101 width(),
102 height(), 102 height(),
103 pixel_format())); 103 pixel_format()));
104 data->mutable_dirty_rects().assign(1, dirtyRect); 104 data->mutable_dirty_rects().assign(1, dirtyRect);
105 FinishCapture(data, callback); 105 FinishCapture(data, callback);
106 } 106 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 CGDisplayChangeSummaryFlags flags, 151 CGDisplayChangeSummaryFlags flags,
152 void *user_parameter) { 152 void *user_parameter) {
153 if ((display == CGMainDisplayID()) && 153 if ((display == CGMainDisplayID()) &&
154 !(flags & kCGDisplayBeginConfigurationFlag)) { 154 !(flags & kCGDisplayBeginConfigurationFlag)) {
155 CapturerMac *capturer = reinterpret_cast<CapturerMac *>(user_parameter); 155 CapturerMac *capturer = reinterpret_cast<CapturerMac *>(user_parameter);
156 capturer->ScreenConfigurationChanged(); 156 capturer->ScreenConfigurationChanged();
157 } 157 }
158 } 158 }
159 159
160 } // namespace remoting 160 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/capturer_gdi.cc ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698