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

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

Issue 4255001: Revert 64672 - Cleanups in the video encoding decoding code. Reenable VP8.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/capturer_fake_ascii.cc ('k') | remoting/host/capturer_linux.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 #include "remoting/host/differ.h" 6 #include "remoting/host/differ.h"
7 7
8 #include "gfx/rect.h" 8 #include "gfx/rect.h"
9 9
10 namespace remoting { 10 namespace remoting {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 desktop_dc_ = GetDC(GetDesktopWindow()); 51 desktop_dc_ = GetDC(GetDesktopWindow());
52 memory_dc_ = CreateCompatibleDC(desktop_dc_); 52 memory_dc_ = CreateCompatibleDC(desktop_dc_);
53 53
54 // Create a bitmap to keep the desktop image. 54 // Create a bitmap to keep the desktop image.
55 width_ = GetSystemMetrics(SM_CXSCREEN); 55 width_ = GetSystemMetrics(SM_CXSCREEN);
56 height_ = GetSystemMetrics(SM_CYSCREEN); 56 height_ = GetSystemMetrics(SM_CYSCREEN);
57 int rounded_width = (width_ + 3) & (~3); 57 int rounded_width = (width_ + 3) & (~3);
58 58
59 // Dimensions of screen. 59 // Dimensions of screen.
60 pixel_format_ = PIXEL_FORMAT_RGB32; 60 pixel_format_ = PixelFormatRgb32;
61 bytes_per_row_ = rounded_width * kBytesPerPixel; 61 bytes_per_row_ = rounded_width * kBytesPerPixel;
62 62
63 // Create a differ for this screen size. 63 // Create a differ for this screen size.
64 differ_.reset(new Differ(width_, height_, 4, bytes_per_row_)); 64 differ_.reset(new Differ(width_, height_, 4, bytes_per_row_));
65 65
66 // Create a device independant bitmap (DIB) that is the same size. 66 // Create a device independant bitmap (DIB) that is the same size.
67 BITMAPINFO bmi; 67 BITMAPINFO bmi;
68 memset(&bmi, 0, sizeof(bmi)); 68 memset(&bmi, 0, sizeof(bmi));
69 bmi.bmiHeader.biHeight = height_; 69 bmi.bmiHeader.biHeight = height_;
70 bmi.bmiHeader.biWidth = width_; 70 bmi.bmiHeader.biWidth = width_;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void CapturerGdi::CaptureImage() { 128 void CapturerGdi::CaptureImage() {
129 // Select the target bitmap into the memory dc. 129 // Select the target bitmap into the memory dc.
130 SelectObject(memory_dc_, target_bitmap_[current_buffer_]); 130 SelectObject(memory_dc_, target_bitmap_[current_buffer_]);
131 131
132 // And then copy the rect from desktop to memory. 132 // And then copy the rect from desktop to memory.
133 BitBlt(memory_dc_, 0, 0, width_, height_, desktop_dc_, 0, 0, 133 BitBlt(memory_dc_, 0, 0, width_, height_, desktop_dc_, 0, 0,
134 SRCCOPY | CAPTUREBLT); 134 SRCCOPY | CAPTUREBLT);
135 } 135 }
136 136
137 } // namespace remoting 137 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/capturer_fake_ascii.cc ('k') | remoting/host/capturer_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698