OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void WebImageDecoder::reset() { | 44 void WebImageDecoder::reset() { |
45 delete m_private; | 45 delete m_private; |
46 } | 46 } |
47 | 47 |
48 void WebImageDecoder::init(Type type) { | 48 void WebImageDecoder::init(Type type) { |
49 size_t maxDecodedBytes = Platform::current()->maxDecodedImageBytes(); | 49 size_t maxDecodedBytes = Platform::current()->maxDecodedImageBytes(); |
50 | 50 |
51 switch (type) { | 51 switch (type) { |
52 case TypeBMP: | 52 case TypeBMP: |
53 m_private = new BMPImageDecoder(ImageDecoder::AlphaPremultiplied, | 53 m_private = |
54 ImageDecoder::GammaAndColorProfileApplied, | 54 new BMPImageDecoder(ImageDecoder::AlphaPremultiplied, |
55 maxDecodedBytes); | 55 ImageDecoder::ColorSpaceApplied, maxDecodedBytes); |
56 break; | 56 break; |
57 case TypeICO: | 57 case TypeICO: |
58 m_private = new ICOImageDecoder(ImageDecoder::AlphaPremultiplied, | 58 m_private = |
59 ImageDecoder::GammaAndColorProfileApplied, | 59 new ICOImageDecoder(ImageDecoder::AlphaPremultiplied, |
60 maxDecodedBytes); | 60 ImageDecoder::ColorSpaceApplied, maxDecodedBytes); |
61 break; | 61 break; |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 void WebImageDecoder::setData(const WebData& data, bool allDataReceived) { | 65 void WebImageDecoder::setData(const WebData& data, bool allDataReceived) { |
66 DCHECK(m_private); | 66 DCHECK(m_private); |
67 m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived); | 67 m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived); |
68 } | 68 } |
69 | 69 |
70 bool WebImageDecoder::isFailed() const { | 70 bool WebImageDecoder::isFailed() const { |
(...skipping 26 matching lines...) Expand all Loading... |
97 | 97 |
98 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const { | 98 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const { |
99 DCHECK(m_private); | 99 DCHECK(m_private); |
100 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); | 100 ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index); |
101 if (!frameBuffer) | 101 if (!frameBuffer) |
102 return WebImage(); | 102 return WebImage(); |
103 return WebImage(frameBuffer->bitmap()); | 103 return WebImage(frameBuffer->bitmap()); |
104 } | 104 } |
105 | 105 |
106 } // namespace blink | 106 } // namespace blink |
OLD | NEW |