Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: remoting/host/encoder_verbatim.cc

Issue 2863028: remoting: Use GetBytesPerPixel util function in one more place. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/encoder_verbatim.cc
diff --git a/remoting/host/encoder_verbatim.cc b/remoting/host/encoder_verbatim.cc
index e51248ce644b541139bef69d4b04574ee454cc99..3151c72a91704ecf3020273ff1df242aac4f53fc 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698