diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 19:34:34 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 19:34:34 +0000 |
commit | f42665874352b21abec147ef14c94ccfd04bc1ae (patch) | |
tree | 95e5446896c8fc7c4a8d7bb22befe9c386bfcb4c | |
parent | 432c01afc9975f4a4f251eed1268e4a79e301e66 (diff) | |
download | chromium_src-f42665874352b21abec147ef14c94ccfd04bc1ae.zip chromium_src-f42665874352b21abec147ef14c94ccfd04bc1ae.tar.gz chromium_src-f42665874352b21abec147ef14c94ccfd04bc1ae.tar.bz2 |
remoting: Use GetBytesPerPixel util function in one more place.
Note: This fix another TODO for hclam, missed in the other patch.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/2863028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51018 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/host/encoder_verbatim.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/remoting/host/encoder_verbatim.cc b/remoting/host/encoder_verbatim.cc index e51248c..3151c72 100644 --- a/remoting/host/encoder_verbatim.cc +++ b/remoting/host/encoder_verbatim.cc @@ -6,7 +6,7 @@ #include "gfx/rect.h" #include "media/base/data_buffer.h" -#include "remoting/base/protocol/chromotocol.pb.h" +#include "remoting/base/protocol_util.h" namespace remoting { @@ -48,19 +48,7 @@ void EncoderVerbatim::SetSize(int width, int height) { } void EncoderVerbatim::SetPixelFormat(PixelFormat pixel_format) { - // These are sorted so that the most common formats are checked first. - // TODO(hclam): Extract this into a util function. - if (pixel_format == PixelFormatRgb24) { - bytes_per_pixel_ = 3; - } else if (pixel_format == PixelFormatRgb565) { - bytes_per_pixel_ = 2; - } else if (pixel_format == PixelFormatRgb32) { - bytes_per_pixel_ = 4; - } else if (pixel_format != PixelFormatAscii) { - bytes_per_pixel_ = 1; - } else { - NOTREACHED() << "Pixel format not supported"; - } + bytes_per_pixel_ = GetBytesPerPixel(pixel_format); pixel_format_ = pixel_format; } |