OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 ASSERT(!frame || (frame->width() && frame->height())); | 232 ASSERT(!frame || (frame->width() && frame->height())); |
233 if (!frame) { | 233 if (!frame) { |
234 rejectPromise(); | 234 rejectPromise(); |
235 return; | 235 return; |
236 } | 236 } |
237 | 237 |
238 RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(frame); | 238 RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(frame); |
239 image->setOriginClean(true); | 239 image->setOriginClean(true); |
240 if (!m_cropRect.width() && !m_cropRect.height()) { | 240 if (!m_cropRect.width() && !m_cropRect.height()) { |
241 // No cropping variant was called. | 241 // No cropping variant was called. |
242 m_cropRect = IntRect(IntPoint(), image->size()); | 242 m_cropRect = IntRect(IntPoint(), image->defaultConcreteObjectSize()); |
243 } | 243 } |
244 | 244 |
245 RefPtrWillBeRawPtr<ImageBitmap> imageBitmap = ImageBitmap::create(image, m_c
ropRect, m_options); | 245 RefPtrWillBeRawPtr<ImageBitmap> imageBitmap = ImageBitmap::create(image, m_c
ropRect, m_options); |
246 m_resolver->resolve(imageBitmap.release()); | 246 m_resolver->resolve(imageBitmap.release()); |
247 m_factory->didFinishLoading(this); | 247 m_factory->didFinishLoading(this); |
248 } | 248 } |
249 | 249 |
250 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) | 250 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) |
251 { | 251 { |
252 visitor->trace(m_factory); | 252 visitor->trace(m_factory); |
253 visitor->trace(m_resolver); | 253 visitor->trace(m_resolver); |
254 } | 254 } |
255 | 255 |
256 } // namespace blink | 256 } // namespace blink |
OLD | NEW |