| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 ASSERT(m_frameGenerator); | 95 ASSERT(m_frameGenerator); |
| 96 frameData->m_hasAlpha = m_frameGenerator->hasAlpha(index); | 96 frameData->m_hasAlpha = m_frameGenerator->hasAlpha(index); |
| 97 frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData); | 97 frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData); |
| 98 return createFrameImageAtIndex(index, !frameData->m_hasAlpha); | 98 return createFrameImageAtIndex(index, !frameData->m_hasAlpha); |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (!m_actualDecoder || m_actualDecoder->failed()) | 101 if (!m_actualDecoder || m_actualDecoder->failed()) |
| 102 return nullptr; | 102 return nullptr; |
| 103 | 103 |
| 104 ImageFrame* frame = m_actualDecoder->frameBufferAtIndex(index); | 104 ImageFrame* frame = m_actualDecoder->frameBufferAtIndex(index); |
| 105 if (!frame || frame->status() == ImageFrame::FrameEmpty) | 105 if (!frame || frame->getStatus() == ImageFrame::FrameEmpty) |
| 106 return nullptr; | 106 return nullptr; |
| 107 | 107 |
| 108 return adoptRef(SkImage::NewFromBitmap(frame->bitmap())); | 108 return adoptRef(SkImage::NewFromBitmap(frame->bitmap())); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived) | 111 void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived) |
| 112 { | 112 { |
| 113 if (m_actualDecoder) { | 113 if (m_actualDecoder) { |
| 114 m_data = RefPtr<SharedBuffer>(data); | 114 m_data = RefPtr<SharedBuffer>(data); |
| 115 m_lastDataSize = data.size(); | 115 m_lastDataSize = data.size(); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 return image.release(); | 290 return image.release(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const | 293 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const |
| 294 { | 294 { |
| 295 // TODO: Implement. | 295 // TODO: Implement. |
| 296 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; | 296 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace blink | 299 } // namespace blink |
| OLD | NEW |