From ef0a59a6fd722a0910196c951dc676c19127a28b Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Wed, 9 Jun 2010 21:56:39 +0000 Subject: Implement a chromoting client using X11 Using XRender to render the chromoting client. This patch has done several things: 1. Rename chromotocol_pb to remoting 2. Defined ChromotingView as the display area of the remote view 3. Implemented X11Client as the client that uses X11 for display 4. Implemented X11View that uses XRender for drawing 5. Fixed several problems in host capturer and encoder Review URL: http://codereview.chromium.org/2745006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49329 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/capturer_fake.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'remoting/host/capturer_fake.cc') diff --git a/remoting/host/capturer_fake.cc b/remoting/host/capturer_fake.cc index 5c087b39..f1a8135 100644 --- a/remoting/host/capturer_fake.cc +++ b/remoting/host/capturer_fake.cc @@ -8,9 +8,9 @@ namespace remoting { -static const int kWidth = 640; -static const int kHeight = 480; -static const int kBytesPerPixel = 3; // 24 bit RGB is 3 bytes per pixel. +static const int kWidth = 320; +static const int kHeight = 240; +static const int kBytesPerPixel = 4; // 32 bit RGB is 4 bytes per pixel. static const int kMaxColorChannelValue = 255; CapturerFake::CapturerFake() @@ -18,7 +18,7 @@ CapturerFake::CapturerFake() // Dimensions of screen. width_ = kWidth; height_ = kHeight; - pixel_format_ = chromotocol_pb::PixelFormatRgb24; + pixel_format_ = PixelFormatRgb32; bytes_per_pixel_ = kBytesPerPixel; bytes_per_row_ = width_ * bytes_per_pixel_; @@ -75,12 +75,14 @@ void CapturerFake::GetDataStride(int strides[]) const { void CapturerFake::GenerateImage() { uint8* row = buffers_[current_buffer_].get(); for (int y = 0; y < height_; ++y) { + int offset = y % 3; for (int x = 0; x < width_; ++x) { - row[x] = seed_++; + row[x * kBytesPerPixel + offset] = seed_++; seed_ &= kMaxColorChannelValue; } row += bytes_per_row_; } + ++seed_; } } // namespace remoting -- cgit v1.1