| 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/color_analysis.h" | 5 #include "ui/gfx/color_analysis.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
| 14 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
| 15 #include "ui/gfx/rect.h" | |
| 16 | 16 |
| 17 namespace color_utils { | 17 namespace color_utils { |
| 18 | 18 |
| 19 const unsigned char k1x1White[] = { | 19 const unsigned char k1x1White[] = { |
| 20 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, | 20 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, |
| 21 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, | 21 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, |
| 22 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, | 22 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, |
| 23 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, | 23 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, |
| 24 0xde, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, | 24 0xde, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, |
| 25 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, | 25 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 Calculate8bitBitmapMinMax(result, &min_gl, &max_gl); | 495 Calculate8bitBitmapMinMax(result, &min_gl, &max_gl); |
| 496 | 496 |
| 497 EXPECT_EQ(0, min_gl); | 497 EXPECT_EQ(0, min_gl); |
| 498 EXPECT_EQ(255, max_gl); | 498 EXPECT_EQ(255, max_gl); |
| 499 EXPECT_EQ(min_gl, SkColorGetA(result.getColor(0, 0))); | 499 EXPECT_EQ(min_gl, SkColorGetA(result.getColor(0, 0))); |
| 500 EXPECT_EQ(max_gl, SkColorGetA(result.getColor(299, 199))); | 500 EXPECT_EQ(max_gl, SkColorGetA(result.getColor(299, 199))); |
| 501 EXPECT_EQ(93U, SkColorGetA(result.getColor(150, 0))); | 501 EXPECT_EQ(93U, SkColorGetA(result.getColor(150, 0))); |
| 502 } | 502 } |
| 503 | 503 |
| 504 } // namespace color_utils | 504 } // namespace color_utils |
| OLD | NEW |