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 "cc/test/pixel_test_utils.h" | 5 #include "cc/test/pixel_test_utils.h" |
6 | 6 |
| 7 #include <string> |
| 8 #include <vector> |
| 9 |
7 #include "base/file_util.h" | 10 #include "base/file_util.h" |
8 #include "base/logging.h" | 11 #include "base/logging.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "ui/gfx/codec/png_codec.h" | 13 #include "ui/gfx/codec/png_codec.h" |
11 | 14 |
12 namespace cc { | 15 namespace cc { |
13 | 16 |
14 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { | 17 bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { |
15 std::vector<unsigned char> png_data; | 18 std::vector<unsigned char> png_data; |
16 const bool discard_transparency = true; | 19 const bool discard_transparency = true; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 72 |
70 if (diff_pixels_count != 0) { | 73 if (diff_pixels_count != 0) { |
71 LOG(ERROR) << "Images differ by pixel count: " << diff_pixels_count; | 74 LOG(ERROR) << "Images differ by pixel count: " << diff_pixels_count; |
72 return false; | 75 return false; |
73 } | 76 } |
74 | 77 |
75 return true; | 78 return true; |
76 } | 79 } |
77 | 80 |
78 } // namespace cc | 81 } // namespace cc |
OLD | NEW |