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" | 19 #include "third_party/base/logging.h" |
20 #include "../third_party/lpng_v163/png.h" | 20 #include "third_party/lpng_v163/png.h" |
21 #include "../third_party/zlib_v128/zlib.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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 int height, | 625 int height, |
626 int row_byte_width, | 626 int row_byte_width, |
627 bool discard_transparency, | 627 bool discard_transparency, |
628 std::vector<unsigned char>* output) { | 628 std::vector<unsigned char>* output) { |
629 return Encode(input, FORMAT_BGRA, | 629 return Encode(input, FORMAT_BGRA, |
630 width, height, row_byte_width, discard_transparency, | 630 width, height, row_byte_width, discard_transparency, |
631 std::vector<Comment>(), output); | 631 std::vector<Comment>(), output); |
632 } | 632 } |
633 | 633 |
634 } // image_diff_png | 634 } // image_diff_png |
OLD | NEW |