OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 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_IMAGE_UNITTEST_UTIL_H_ | 8 #ifndef UI_GFX_IMAGE_IMAGE_UNITTEST_UTIL_H_ |
9 #define UI_GFX_IMAGE_IMAGE_UNITTEST_UTIL_H_ | 9 #define UI_GFX_IMAGE_IMAGE_UNITTEST_UTIL_H_ |
10 | 10 |
11 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
12 #include "third_party/skia/include/core/SkColor.h" | |
13 | 12 |
14 namespace gfx { | 13 namespace gfx { |
15 namespace test { | 14 namespace test { |
16 | 15 |
17 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
18 typedef NSImage* PlatformImage; | 17 typedef NSImage* PlatformImage; |
19 #elif defined(TOOLKIT_GTK) | 18 #elif defined(TOOLKIT_GTK) |
20 typedef GdkPixbuf* PlatformImage; | 19 typedef GdkPixbuf* PlatformImage; |
21 #else | 20 #else |
22 typedef const SkBitmap PlatformImage; | 21 typedef const SkBitmap PlatformImage; |
(...skipping 11 matching lines...) Expand all Loading... |
34 | 33 |
35 bool IsEqual(const gfx::Image& image1, const gfx::Image& image2); | 34 bool IsEqual(const gfx::Image& image1, const gfx::Image& image2); |
36 | 35 |
37 bool IsEmpty(const gfx::Image& image); | 36 bool IsEmpty(const gfx::Image& image); |
38 | 37 |
39 PlatformImage CreatePlatformImage(); | 38 PlatformImage CreatePlatformImage(); |
40 | 39 |
41 gfx::Image::RepresentationType GetPlatformRepresentationType(); | 40 gfx::Image::RepresentationType GetPlatformRepresentationType(); |
42 | 41 |
43 PlatformImage ToPlatformType(const gfx::Image& image); | 42 PlatformImage ToPlatformType(const gfx::Image& image); |
44 PlatformImage CopyPlatformType(const gfx::Image& image); | |
45 | |
46 SkColor GetPlatformImageColor(PlatformImage image); | |
47 void CheckColor(SkColor color, bool is_red); | |
48 | 43 |
49 bool IsPlatformImageValid(PlatformImage image); | 44 bool IsPlatformImageValid(PlatformImage image); |
50 | 45 |
51 bool PlatformImagesEqual(PlatformImage image1, PlatformImage image2); | 46 bool PlatformImagesEqual(PlatformImage image1, PlatformImage image2); |
52 | 47 |
53 } // namespace test | 48 } // namespace test |
54 } // namespace gfx | 49 } // namespace gfx |
55 | 50 |
56 #endif // UI_GFX_IMAGE_IMAGE_UNITTEST_UTIL_H_ | 51 #endif // UI_GFX_IMAGE_IMAGE_UNITTEST_UTIL_H_ |
OLD | NEW |