| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * Copyright (C) 2010 Google Inc. All rights reserved. | 6 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 LocalFrame* frame = GetDocument().GetFrame(); | 134 LocalFrame* frame = GetDocument().GetFrame(); |
| 135 // If we don't have the image, or the document doesn't have a frame, then | 135 // If we don't have the image, or the document doesn't have a frame, then |
| 136 // reject the decode, since we can't plumb the request to the correct place. | 136 // reject the decode, since we can't plumb the request to the correct place. |
| 137 if (!GetImageLoader().GetImage() || | 137 if (!GetImageLoader().GetImage() || |
| 138 !GetImageLoader().GetImage()->GetImage() || !frame) { | 138 !GetImageLoader().GetImage()->GetImage() || !frame) { |
| 139 DecodeRequestFinished(decode_sequence_id_, false); | 139 DecodeRequestFinished(decode_sequence_id_, false); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 Image* image = GetImageLoader().GetImage()->GetImage(); | 142 Image* image = GetImageLoader().GetImage()->GetImage(); |
| 143 frame->GetChromeClient().RequestDecode( | 143 frame->GetChromeClient().RequestDecode( |
| 144 frame, image->ImageForCurrentFrame(), | 144 frame, image->PaintImageForCurrentFrame(), |
| 145 WTF::Bind(&HTMLImageElement::DecodeRequestFinished, | 145 WTF::Bind(&HTMLImageElement::DecodeRequestFinished, |
| 146 WrapWeakPersistent(this), decode_sequence_id_)); | 146 WrapWeakPersistent(this), decode_sequence_id_)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void HTMLImageElement::DecodeRequestFinished(uint32_t sequence_id, | 149 void HTMLImageElement::DecodeRequestFinished(uint32_t sequence_id, |
| 150 bool success) { | 150 bool success) { |
| 151 // If the sequence id attached with this callback doesn't match our current | 151 // If the sequence id attached with this callback doesn't match our current |
| 152 // sequence id, then the source of the image has changed. In other words, the | 152 // sequence id, then the source of the image has changed. In other words, the |
| 153 // decode resolved/rejected by this callback was already rejected. Since we | 153 // decode resolved/rejected by this callback was already rejected. Since we |
| 154 // could have had a new decode request, we have to make sure not to | 154 // could have had a new decode request, we have to make sure not to |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 form_->Associate(*this); | 895 form_->Associate(*this); |
| 896 form_->DidAssociateByParser(); | 896 form_->DidAssociateByParser(); |
| 897 } | 897 } |
| 898 }; | 898 }; |
| 899 | 899 |
| 900 FloatSize HTMLImageElement::SourceDefaultObjectSize() { | 900 FloatSize HTMLImageElement::SourceDefaultObjectSize() { |
| 901 return FloatSize(width(), height()); | 901 return FloatSize(width(), height()); |
| 902 } | 902 } |
| 903 | 903 |
| 904 } // namespace blink | 904 } // namespace blink |
| OLD | NEW |