OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/gfx/ipc/gfx_param_traits.h" | 5 #include "ui/gfx/ipc/gfx_param_traits.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <string> | 10 #include <string> |
8 | 11 |
9 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "ui/gfx/geometry/point3_f.h" | 13 #include "ui/gfx/geometry/point3_f.h" |
11 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
13 #include "ui/gfx/geometry/scroll_offset.h" | 16 #include "ui/gfx/geometry/scroll_offset.h" |
14 #include "ui/gfx/range/range.h" | 17 #include "ui/gfx/range/range.h" |
15 | 18 |
16 namespace { | 19 namespace { |
17 | 20 |
18 struct SkBitmap_Data { | 21 struct SkBitmap_Data { |
19 // The color type for the bitmap (bits per pixel, etc). | 22 // The color type for the bitmap (bits per pixel, etc). |
20 SkColorType fColorType; | 23 SkColorType fColorType; |
21 | 24 |
22 // The alpha type for the bitmap (opaque, premul, unpremul). | 25 // The alpha type for the bitmap (opaque, premul, unpremul). |
23 SkAlphaType fAlphaType; | 26 SkAlphaType fAlphaType; |
24 | 27 |
25 // The width of the bitmap in pixels. | 28 // The width of the bitmap in pixels. |
26 uint32 fWidth; | 29 uint32_t fWidth; |
27 | 30 |
28 // The height of the bitmap in pixels. | 31 // The height of the bitmap in pixels. |
29 uint32 fHeight; | 32 uint32_t fHeight; |
30 | 33 |
31 void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) { | 34 void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) { |
32 const SkImageInfo& info = bitmap.info(); | 35 const SkImageInfo& info = bitmap.info(); |
33 fColorType = info.colorType(); | 36 fColorType = info.colorType(); |
34 fAlphaType = info.alphaType(); | 37 fAlphaType = info.alphaType(); |
35 fWidth = info.width(); | 38 fWidth = info.width(); |
36 fHeight = info.height(); | 39 fHeight = info.height(); |
37 } | 40 } |
38 | 41 |
39 // Returns whether |bitmap| successfully initialized. | 42 // Returns whether |bitmap| successfully initialized. |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ | 355 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ |
353 #include "ui/gfx/ipc/gfx_param_traits_macros.h" | 356 #include "ui/gfx/ipc/gfx_param_traits_macros.h" |
354 } // namespace IPC | 357 } // namespace IPC |
355 | 358 |
356 // Generate param traits log methods. | 359 // Generate param traits log methods. |
357 #include "ipc/param_traits_log_macros.h" | 360 #include "ipc/param_traits_log_macros.h" |
358 namespace IPC { | 361 namespace IPC { |
359 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ | 362 #undef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ |
360 #include "ui/gfx/ipc/gfx_param_traits_macros.h" | 363 #include "ui/gfx/ipc/gfx_param_traits_macros.h" |
361 } // namespace IPC | 364 } // namespace IPC |
OLD | NEW |