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

Side by Side Diff: third_party/WebKit/Source/core/frame/ImageBitmap.cpp

Issue 1767633002: Support canvas size as default object size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-default-object-size
Patch Set: Rebase 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/ImageBitmap.h" 5 #include "core/frame/ImageBitmap.h"
6 6
7 #include "core/html/HTMLCanvasElement.h" 7 #include "core/html/HTMLCanvasElement.h"
8 #include "core/html/HTMLVideoElement.h" 8 #include "core/html/HTMLVideoElement.h"
9 #include "core/html/ImageData.h" 9 #include "core/html/ImageData.h"
10 #include "platform/image-decoders/ImageDecoder.h" 10 #include "platform/image-decoders/ImageDecoder.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou rce %s provided is 0.", sw ? "height" : "width")); 342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou rce %s provided is 0.", sw ? "height" : "width"));
343 return ScriptPromise(); 343 return ScriptPromise();
344 } 344 }
345 return ImageBitmapSource::fulfillImageBitmap(scriptState, create(this, IntRe ct(sx, sy, sw, sh), options)); 345 return ImageBitmapSource::fulfillImageBitmap(scriptState, create(this, IntRe ct(sx, sy, sw, sh), options));
346 } 346 }
347 347
348 void ImageBitmap::notifyImageSourceChanged() 348 void ImageBitmap::notifyImageSourceChanged()
349 { 349 {
350 } 350 }
351 351
352 PassRefPtr<Image> ImageBitmap::getSourceImageForCanvas(SourceImageStatus* status , AccelerationHint, SnapshotReason) const 352 PassRefPtr<Image> ImageBitmap::getSourceImageForCanvas(SourceImageStatus* status , AccelerationHint, SnapshotReason, const FloatSize&) const
353 { 353 {
354 *status = NormalSourceImageStatus; 354 *status = NormalSourceImageStatus;
355 return m_image ? m_image : nullptr; 355 return m_image ? m_image : nullptr;
356 } 356 }
357 357
358 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const 358 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const
359 { 359 {
360 } 360 }
361 361
362 FloatSize ImageBitmap::elementSize() const 362 FloatSize ImageBitmap::elementSize(const FloatSize&) const
363 { 363 {
364 return FloatSize(width(), height()); 364 return FloatSize(width(), height());
365 } 365 }
366 366
367 DEFINE_TRACE(ImageBitmap) 367 DEFINE_TRACE(ImageBitmap)
368 { 368 {
369 ImageLoaderClient::trace(visitor); 369 ImageLoaderClient::trace(visitor);
370 } 370 }
371 371
372 } // namespace blink 372 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698