| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (frameSize == lastSize) | 99 if (frameSize == lastSize) |
| 100 continue; | 100 continue; |
| 101 lastSize = frameSize; | 101 lastSize = frameSize; |
| 102 | 102 |
| 103 ImageFrame* frame = decoder->frameBufferAtIndex(i); | 103 ImageFrame* frame = decoder->frameBufferAtIndex(i); |
| 104 if (!frame) | 104 if (!frame) |
| 105 continue; | 105 continue; |
| 106 | 106 |
| 107 SkBitmap bitmap = frame->bitmap(); | 107 SkBitmap bitmap = frame->bitmap(); |
| 108 if (!bitmap.isNull() && frame->getStatus() == ImageFrame::FrameComplete) | 108 if (!bitmap.isNull() && frame->getStatus() == ImageFrame::FrameComplete) |
| 109 frames.append(WebImage(bitmap)); | 109 frames.push_back(WebImage(bitmap)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 return frames; | 112 return frames; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void WebImage::reset() { | 115 void WebImage::reset() { |
| 116 m_bitmap.reset(); | 116 m_bitmap.reset(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void WebImage::assign(const WebImage& image) { | 119 void WebImage::assign(const WebImage& image) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 // TODO(ccameron): WebImage needs to be consistent about color spaces. | 135 // TODO(ccameron): WebImage needs to be consistent about color spaces. |
| 136 // https://crbug.com/672315 | 136 // https://crbug.com/672315 |
| 137 if (sk_sp<SkImage> skImage = | 137 if (sk_sp<SkImage> skImage = |
| 138 image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget())) | 138 image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget())) |
| 139 skImage->asLegacyBitmap(&m_bitmap, SkImage::kRO_LegacyBitmapMode); | 139 skImage->asLegacyBitmap(&m_bitmap, SkImage::kRO_LegacyBitmapMode); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |