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 "chrome/browser/thumbnails/content_analysis.h" | 5 #include "chrome/browser/thumbnails/content_analysis.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 #include <cmath> | 11 #include <cmath> |
12 #include <cstdlib> | 12 #include <cstdlib> |
13 #include <functional> | 13 #include <functional> |
14 #include <limits> | 14 #include <limits> |
15 #include <memory> | 15 #include <memory> |
16 #include <numeric> | 16 #include <numeric> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
| 19 #include "skia/ext/platform_canvas.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
21 #include "third_party/skia/include/core/SkColor.h" | 22 #include "third_party/skia/include/core/SkColor.h" |
22 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
23 #include "ui/gfx/color_analysis.h" | 24 #include "ui/gfx/color_analysis.h" |
24 #include "ui/gfx/color_utils.h" | 25 #include "ui/gfx/color_utils.h" |
25 #include "ui/gfx/geometry/rect.h" | 26 #include "ui/gfx/geometry/rect.h" |
26 #include "ui/gfx/geometry/size.h" | 27 #include "ui/gfx/geometry/size.h" |
27 #include "ui/gfx/image/image.h" | 28 #include "ui/gfx/image/image.h" |
28 | 29 |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 | 680 |
680 int histogram[256] = {}; | 681 int histogram[256] = {}; |
681 color_utils::BuildLumaHistogram(result, histogram); | 682 color_utils::BuildLumaHistogram(result, histogram); |
682 int non_zero_color_count = std::count_if( | 683 int non_zero_color_count = std::count_if( |
683 histogram, histogram + 256, [](int value) { return value > 0; }); | 684 histogram, histogram + 256, [](int value) { return value > 0; }); |
684 EXPECT_GT(non_zero_color_count, 4); | 685 EXPECT_GT(non_zero_color_count, 4); |
685 | 686 |
686 } | 687 } |
687 | 688 |
688 } // namespace thumbnailing_utils | 689 } // namespace thumbnailing_utils |
OLD | NEW |