OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Because the unit tests for ui::gfx::Image are spread across multiple | 5 // Because the unit tests for gfx::Image are spread across multiple |
6 // implementation files, this header contains the reusable components. | 6 // implementation files, this header contains the reusable components. |
7 | 7 |
8 #ifndef UI_GFX_IMAGE_UNITTEST_H_ | 8 #ifndef UI_GFX_IMAGE_UNITTEST_H_ |
9 #define UI_GFX_IMAGE_UNITTEST_H_ | 9 #define UI_GFX_IMAGE_UNITTEST_H_ |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 | 14 |
15 #if defined(OS_LINUX) | 15 #if defined(OS_LINUX) |
16 #include "ui/gfx/gtk_util.h" | 16 #include "ui/gfx/gtk_util.h" |
17 #elif defined(OS_MACOSX) | 17 #elif defined(OS_MACOSX) |
18 #include "base/mac/mac_util.h" | 18 #include "base/mac/mac_util.h" |
19 #include "skia/ext/skia_utils_mac.h" | 19 #include "skia/ext/skia_utils_mac.h" |
20 #endif | 20 #endif |
21 | 21 |
22 namespace ui { | |
23 namespace gfx { | 22 namespace gfx { |
24 namespace test { | 23 namespace test { |
25 | 24 |
26 #if defined(OS_MACOSX) | 25 #if defined(OS_MACOSX) |
27 typedef NSImage* PlatformImage; | 26 typedef NSImage* PlatformImage; |
28 #elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 27 #elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
29 typedef GdkPixbuf* PlatformImage; | 28 typedef GdkPixbuf* PlatformImage; |
30 #else | 29 #else |
31 typedef const SkBitmap* PlatformImage; | 30 typedef const SkBitmap* PlatformImage; |
32 #endif | 31 #endif |
(...skipping 14 matching lines...) Expand all Loading... |
47 return image; | 46 return image; |
48 #elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 47 #elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
49 return ::gfx::GdkPixbufFromSkBitmap(bitmap.get()); | 48 return ::gfx::GdkPixbufFromSkBitmap(bitmap.get()); |
50 #else | 49 #else |
51 return bitmap.release(); | 50 return bitmap.release(); |
52 #endif | 51 #endif |
53 } | 52 } |
54 | 53 |
55 } // namespace test | 54 } // namespace test |
56 } // namespace gfx | 55 } // namespace gfx |
57 } // namespace ui | |
58 | 56 |
59 #endif // UI_GFX_IMAGE_UNITTEST_H_ | 57 #endif // UI_GFX_IMAGE_UNITTEST_H_ |
OLD | NEW |