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

Side by Side Diff: remoting/host/capturer_gdi.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_fake_ascii.cc ('k') | remoting/host/capturer_mac.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_gdi.h" 5 #include "remoting/host/capturer_gdi.h"
6 6
7 #include "gfx/rect.h" 7 #include "gfx/rect.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Create memory for the buffers. 72 // Create memory for the buffers.
73 for (int i = 0; i < kNumBuffers; i++) { 73 for (int i = 0; i < kNumBuffers; i++) {
74 target_bitmap_[i] = CreateDIBSection(desktop_dc_, &bmi, DIB_RGB_COLORS, 74 target_bitmap_[i] = CreateDIBSection(desktop_dc_, &bmi, DIB_RGB_COLORS,
75 static_cast<void**>(&buffers_[i]), 75 static_cast<void**>(&buffers_[i]),
76 NULL, 0); 76 NULL, 0);
77 } 77 }
78 } 78 }
79 79
80 void CapturerGdi::CaptureRects(const RectVector& rects, 80 void CapturerGdi::CaptureRects(const RectVector& rects,
81 CaptureCompletedCallback* callback) { 81 CaptureCompletedCallback* callback) {
82 Capturer::DataPlanes planes; 82 DataPlanes planes;
83 planes.data[0] = static_cast<uint8*>(buffers_[current_buffer_]); 83 planes.data[0] = static_cast<uint8*>(buffers_[current_buffer_]);
84 planes.strides[0] = bytes_per_row_; 84 planes.strides[0] = bytes_per_row_;
85 85
86 CaptureImage(); 86 CaptureImage();
87 scoped_refptr<CaptureData> data(new CaptureData(planes, 87 scoped_refptr<CaptureData> data(new CaptureData(planes,
88 width(), 88 width(),
89 height(), 89 height(),
90 pixel_format())); 90 pixel_format()));
91 data->mutable_dirty_rects() = rects; 91 data->mutable_dirty_rects() = rects;
92 92
93 FinishCapture(data, callback); 93 FinishCapture(data, callback);
94 } 94 }
95 95
96 void CapturerGdi::CaptureImage() { 96 void CapturerGdi::CaptureImage() {
97 // Selection the target bitmap into the memory dc. 97 // Selection the target bitmap into the memory dc.
98 SelectObject(memory_dc_, target_bitmap_[current_buffer_]); 98 SelectObject(memory_dc_, target_bitmap_[current_buffer_]);
99 99
100 // And then copy the rect from desktop to memory. 100 // And then copy the rect from desktop to memory.
101 BitBlt(memory_dc_, 0, 0, width_, height_, desktop_dc_, 0, 0, 101 BitBlt(memory_dc_, 0, 0, width_, height_, desktop_dc_, 0, 0,
102 SRCCOPY | CAPTUREBLT); 102 SRCCOPY | CAPTUREBLT);
103 } 103 }
104 104
105 } // namespace remoting 105 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/capturer_fake_ascii.cc ('k') | remoting/host/capturer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698