From f42665874352b21abec147ef14c94ccfd04bc1ae Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Mon, 28 Jun 2010 19:34:34 +0000 Subject: 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 --- remoting/host/encoder_verbatim.cc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'remoting/host') 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; } -- cgit v1.1