OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This is a duplicate of chromium's src/tools/imagediff/image_diff_png.cc | 5 // This is a duplicate of chromium's src/tools/imagediff/image_diff_png.cc |
6 // that has been modified to build in a pdfium environment, which itself | 6 // that has been modified to build in a pdfium environment, which itself |
7 // was duplicated as follows: | 7 // was duplicated as follows: |
8 | 8 |
9 // This is a duplicate of ui/gfx/codec/png_codec.cc, after removing code related | 9 // This is a duplicate of ui/gfx/codec/png_codec.cc, after removing code related |
10 // to Skia, that we can use when running layout tests with minimal dependencies. | 10 // to Skia, that we can use when running layout tests with minimal dependencies. |
11 | 11 |
12 #include "image_diff_png.h" | 12 #include "image_diff_png.h" |
13 | 13 |
14 #include <stdlib.h> | 14 #include <stdlib.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 #include <string> | 17 #include <string> |
18 | 18 |
19 #include "../third_party/base/logging.h" | |
20 #include "../third_party/zlib_v128/zlib.h" | |
21 #include "fx_lpng/include/fx_png.h" | 19 #include "fx_lpng/include/fx_png.h" |
| 20 #include "third_party/base/logging.h" |
| 21 #include "third_party/zlib_v128/zlib.h" |
22 | 22 |
23 namespace image_diff_png { | 23 namespace image_diff_png { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 enum ColorFormat { | 27 enum ColorFormat { |
28 // 3 bytes per pixel (packed), in RGB order regardless of endianness. | 28 // 3 bytes per pixel (packed), in RGB order regardless of endianness. |
29 // This is the native JPEG format. | 29 // This is the native JPEG format. |
30 FORMAT_RGB, | 30 FORMAT_RGB, |
31 | 31 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 int height, | 635 int height, |
636 int row_byte_width, | 636 int row_byte_width, |
637 bool discard_transparency, | 637 bool discard_transparency, |
638 std::vector<unsigned char>* output) { | 638 std::vector<unsigned char>* output) { |
639 return Encode(input, FORMAT_BGRA, | 639 return Encode(input, FORMAT_BGRA, |
640 width, height, row_byte_width, discard_transparency, | 640 width, height, row_byte_width, discard_transparency, |
641 std::vector<Comment>(), output); | 641 std::vector<Comment>(), output); |
642 } | 642 } |
643 | 643 |
644 } // image_diff_png | 644 } // image_diff_png |
OLD | NEW |