OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 bool outputScanlines(); | 57 bool outputScanlines(); |
58 unsigned desiredScaleNumerator() const; | 58 unsigned desiredScaleNumerator() const; |
59 void complete(); | 59 void complete(); |
60 | 60 |
61 void setOrientation(ImageOrientation orientation) { m_orientation = orientat
ion; } | 61 void setOrientation(ImageOrientation orientation) { m_orientation = orientat
ion; } |
62 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor
Profile; } | 62 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor
Profile; } |
63 void setDecodedSize(unsigned width, unsigned height); | 63 void setDecodedSize(unsigned width, unsigned height); |
64 | 64 |
65 private: | 65 private: |
66 // ImageDecoder: | 66 // ImageDecoder: |
67 void decodeSize() override { decode(true); } | 67 void decodeSize() override |
| 68 { |
| 69 decode(true); |
| 70 reportStats(ImageJPEG); |
| 71 } |
68 void decode(size_t) override { decode(false); } | 72 void decode(size_t) override { decode(false); } |
69 | 73 |
70 // Decodes the image. If |onlySize| is true, stops decoding after | 74 // Decodes the image. If |onlySize| is true, stops decoding after |
71 // calculating the image size. If decoding fails but there is no more | 75 // calculating the image size. If decoding fails but there is no more |
72 // data coming, sets the "decode failure" flag. | 76 // data coming, sets the "decode failure" flag. |
73 void decode(bool onlySize); | 77 void decode(bool onlySize); |
74 | 78 |
75 OwnPtr<JPEGImageReader> m_reader; | 79 OwnPtr<JPEGImageReader> m_reader; |
76 OwnPtr<ImagePlanes> m_imagePlanes; | 80 OwnPtr<ImagePlanes> m_imagePlanes; |
77 IntSize m_decodedSize; | 81 IntSize m_decodedSize; |
78 bool m_hasColorProfile; | 82 bool m_hasColorProfile; |
79 }; | 83 }; |
80 | 84 |
81 } // namespace blink | 85 } // namespace blink |
82 | 86 |
83 #endif | 87 #endif |
OLD | NEW |