Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/ImageInputType.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698