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 "ui/gfx/image/image_skia.h" | 5 #include "ui/gfx/image/image_skia.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/threading/simple_thread.h" | 9 #include "base/threading/simple_thread.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "ui/gfx/geometry/size.h" |
12 #include "ui/gfx/image/image_skia_rep.h" | 13 #include "ui/gfx/image/image_skia_rep.h" |
13 #include "ui/gfx/image/image_skia_source.h" | 14 #include "ui/gfx/image/image_skia_source.h" |
14 #include "ui/gfx/size.h" | |
15 #include "ui/gfx/switches.h" | 15 #include "ui/gfx/switches.h" |
16 | 16 |
17 // Duplicated from base/threading/non_thread_safe.h so that we can be | 17 // Duplicated from base/threading/non_thread_safe.h so that we can be |
18 // good citizens there and undef the macro. | 18 // good citizens there and undef the macro. |
19 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) | 19 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) |
20 #define ENABLE_NON_THREAD_SAFE 1 | 20 #define ENABLE_NON_THREAD_SAFE 1 |
21 #else | 21 #else |
22 #define ENABLE_NON_THREAD_SAFE 0 | 22 #define ENABLE_NON_THREAD_SAFE 0 |
23 #endif | 23 #endif |
24 | 24 |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 EXPECT_EQ(1U, image.image_reps().size()); | 610 EXPECT_EQ(1U, image.image_reps().size()); |
611 | 611 |
612 const ImageSkiaRep& rep12 = image.GetRepresentation(1.2f); | 612 const ImageSkiaRep& rep12 = image.GetRepresentation(1.2f); |
613 EXPECT_EQ(1.0f, rep12.scale()); | 613 EXPECT_EQ(1.0f, rep12.scale()); |
614 EXPECT_EQ("100x200", rep12.pixel_size().ToString()); | 614 EXPECT_EQ("100x200", rep12.pixel_size().ToString()); |
615 EXPECT_TRUE(rep12.unscaled()); | 615 EXPECT_TRUE(rep12.unscaled()); |
616 EXPECT_EQ(1U, image.image_reps().size()); | 616 EXPECT_EQ(1U, image.image_reps().size()); |
617 } | 617 } |
618 | 618 |
619 } // namespace gfx | 619 } // namespace gfx |
OLD | NEW |