diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 21:42:12 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 21:42:12 +0000 |
commit | 420a5e4ab23188ab8458c659b331da1d580f6dd7 (patch) | |
tree | ccdd9a8f74998b335ea8a96da6e26a633633e9c6 /remoting/host/differ.h | |
parent | 4051754026b9163d6fbbfb329bba3a03a333617c (diff) | |
download | chromium_src-420a5e4ab23188ab8458c659b331da1d580f6dd7.zip chromium_src-420a5e4ab23188ab8458c659b331da1d580f6dd7.tar.gz chromium_src-420a5e4ab23188ab8458c659b331da1d580f6dd7.tar.bz2 |
Move screen capturers to remoting/capturer.
Separating screen capturer code from the rest of remoting code so that it
can be reused for screen capturing in WebRTC. Also added struct
MouseCursorShape to avoid protobuf dependency.
BUG=134249
Review URL: https://codereview.chromium.org/11470028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/differ.h')
-rw-r--r-- | remoting/host/differ.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/remoting/host/differ.h b/remoting/host/differ.h deleted file mode 100644 index c46f57a..0000000 --- a/remoting/host/differ.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_DIFFER_H_ -#define REMOTING_HOST_DIFFER_H_ - -#include <vector> - -#include "base/basictypes.h" -#include "base/memory/scoped_ptr.h" -#include "third_party/skia/include/core/SkRegion.h" - -namespace remoting { - -typedef uint8 DiffInfo; - -// TODO: Simplify differ now that we are working with SkRegions. -// diff_info_ should no longer be needed, as we can put our data directly into -// the region that we are calculating. -// http://crbug.com/92379 -class Differ { - public: - // Create a differ that operates on bitmaps with the specified width, height - // and bytes_per_pixel. - Differ(int width, int height, int bytes_per_pixel, int stride); - ~Differ(); - - int width() { return width_; } - int height() { return height_; } - int bytes_per_pixel() { return bytes_per_pixel_; } - int bytes_per_row() { return bytes_per_row_; } - - // Given the previous and current screen buffer, calculate the dirty region - // that encloses all of the changed pixels in the new screen. - void CalcDirtyRegion(const void* prev_buffer, const void* curr_buffer, - SkRegion* region); - - private: - // Allow tests to access our private parts. - friend class DifferTest; - - // Identify all of the blocks that contain changed pixels. - void MarkDirtyBlocks(const void* prev_buffer, const void* curr_buffer); - - // After the dirty blocks have been identified, this routine merges adjacent - // blocks into a region. - // The goal is to minimize the region that covers the dirty blocks. - void MergeBlocks(SkRegion* region); - - // Check for diffs in upper-left portion of the block. The size of the portion - // to check is specified by the |width| and |height| values. - // Note that if we force the capturer to always return images whose width and - // height are multiples of kBlockSize, then this will never be called. - DiffInfo DiffPartialBlock(const uint8* prev_buffer, const uint8* curr_buffer, - int stride, int width, int height); - - // Dimensions of screen. - int width_; - int height_; - - // Number of bytes for each pixel in source and dest bitmap. - // (Yes, they must match.) - int bytes_per_pixel_; - - // Number of bytes in each row of the image (AKA: stride). - int bytes_per_row_; - - // Diff information for each block in the image. - scoped_array<DiffInfo> diff_info_; - - // Dimensions and total size of diff info array. - int diff_info_width_; - int diff_info_height_; - int diff_info_size_; - - DISALLOW_COPY_AND_ASSIGN(Differ); -}; - -} // namespace remoting - -#endif // REMOTING_HOST_DIFFER_H_ |