| 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 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "third_party/skia/include/core/SkCanvas.h" | 6 #include "third_party/skia/include/core/SkCanvas.h" |
| 7 #include "third_party/skia/include/core/SkPaint.h" | 7 #include "third_party/skia/include/core/SkPaint.h" |
| 8 #include "ui/gfx/image/image.h" | 8 #include "ui/gfx/image/image.h" |
| 9 #include "ui/gfx/image/image_png_rep.h" | 9 #include "ui/gfx/image/image_png_rep.h" |
| 10 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| 11 #include "ui/gfx/image/image_unittest_util.h" | 11 #include "ui/gfx/image/image_unittest_util.h" |
| 12 | 12 |
| 13 #if defined(OS_IOS) | 13 #if defined(OS_IOS) |
| 14 #include "base/mac/foundation_util.h" | 14 #include "base/mac/foundation_util.h" |
| 15 #include "skia/ext/skia_utils_ios.h" | 15 #include "skia/ext/skia_utils_ios.h" |
| 16 #elif defined(OS_MACOSX) | 16 #elif defined(OS_MACOSX) |
| 17 #include "base/mac/mac_util.h" | 17 #include "base/mac/mac_util.h" |
| 18 #include "skia/ext/skia_utils_mac.h" | 18 #include "skia/ext/skia_utils_mac.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 #if defined(TOOLKIT_VIEWS) || defined(OS_ANDROID) || \ | 23 #if defined(OS_IOS) || defined(OS_MACOSX) |
| 24 (defined(OS_LINUX) && !defined(USE_CAIRO)) | 24 const bool kUsesSkiaNatively = false; |
| 25 #else |
| 25 const bool kUsesSkiaNatively = true; | 26 const bool kUsesSkiaNatively = true; |
| 26 #else | |
| 27 const bool kUsesSkiaNatively = false; | |
| 28 #endif | 27 #endif |
| 29 | 28 |
| 30 class ImageTest : public testing::Test { | 29 class ImageTest : public testing::Test { |
| 31 public: | 30 public: |
| 32 ImageTest() { | 31 ImageTest() { |
| 33 std::vector<float> scales; | 32 std::vector<float> scales; |
| 34 scales.push_back(1.0f); | 33 scales.push_back(1.0f); |
| 35 #if !defined(OS_IOS) | 34 #if !defined(OS_IOS) |
| 36 scales.push_back(2.0f); | 35 scales.push_back(2.0f); |
| 37 #endif | 36 #endif |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 gfx::ImageSkiaRep(bitmap, 1.0f))); | 673 gfx::ImageSkiaRep(bitmap, 1.0f))); |
| 675 } | 674 } |
| 676 EXPECT_TRUE(!image.ToSkBitmap()->isNull()); | 675 EXPECT_TRUE(!image.ToSkBitmap()->isNull()); |
| 677 } | 676 } |
| 678 | 677 |
| 679 // Integration tests with UI toolkit frameworks require linking against the | 678 // Integration tests with UI toolkit frameworks require linking against the |
| 680 // Views library and cannot be here (ui_unittests doesn't include it). They | 679 // Views library and cannot be here (ui_unittests doesn't include it). They |
| 681 // instead live in /chrome/browser/ui/tests/ui_gfx_image_unittest.cc. | 680 // instead live in /chrome/browser/ui/tests/ui_gfx_image_unittest.cc. |
| 682 | 681 |
| 683 } // namespace | 682 } // namespace |
| OLD | NEW |