OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/base/util.h" | 5 #include "remoting/base/util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace remoting { | 9 namespace remoting { |
10 | 10 |
11 int GetBytesPerPixel(PixelFormat format) { | 11 int GetBytesPerPixel(PixelFormat format) { |
12 // Note: The order is important here for performance. This is sorted from the | 12 // Note: The order is important here for performance. This is sorted from the |
13 // most common to the less common (PIXEL_FORMAT_ASCII is mostly used | 13 // most common to the less common (PixelFormatAscii is mostly used |
14 // just for testing). | 14 // just for testing). |
15 switch (format) { | 15 switch (format) { |
16 case PIXEL_FORMAT_RGB24: return 3; | 16 case PixelFormatRgb24: return 3; |
17 case PIXEL_FORMAT_RGB565: return 2; | 17 case PixelFormatRgb565: return 2; |
18 case PIXEL_FORMAT_RGB32: return 4; | 18 case PixelFormatRgb32: return 4; |
19 case PIXEL_FORMAT_ASCII: return 1; | 19 case PixelFormatAscii: return 1; |
20 default: | 20 default: |
21 NOTREACHED() << "Pixel format not supported"; | 21 NOTREACHED() << "Pixel format not supported"; |
22 return 0; | 22 return 0; |
23 } | 23 } |
24 } | 24 } |
25 | 25 |
26 } // namespace remoting | 26 } // namespace remoting |
OLD | NEW |