summaryrefslogtreecommitdiffstats
path: root/remoting/host/capturer_fake.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:56:39 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:56:39 +0000
commitef0a59a6fd722a0910196c951dc676c19127a28b (patch)
tree9d90ab9227e4222fa312dadae114c8d2247028bf /remoting/host/capturer_fake.cc
parente9fdd159ffd94e3e097bd6905d84e6b564b04c2c (diff)
downloadchromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.zip
chromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.tar.gz
chromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.tar.bz2
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
Diffstat (limited to 'remoting/host/capturer_fake.cc')
-rw-r--r--remoting/host/capturer_fake.cc12
1 files changed, 7 insertions, 5 deletions
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