| OLD | NEW |
| 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 "core/offscreencanvas/OffscreenCanvas.h" | 10 #include "core/offscreencanvas/OffscreenCanvas.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 } | 945 } |
| 946 | 946 |
| 947 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) { | 947 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) { |
| 948 m_image = image; | 948 m_image = image; |
| 949 } | 949 } |
| 950 | 950 |
| 951 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() { | 951 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() { |
| 952 ASSERT(!isNeutered()); | 952 ASSERT(!isNeutered()); |
| 953 m_isNeutered = true; | 953 m_isNeutered = true; |
| 954 m_image->transfer(); | 954 m_image->transfer(); |
| 955 return m_image.release(); | 955 return std::move(m_image); |
| 956 } | 956 } |
| 957 | 957 |
| 958 ImageBitmap::~ImageBitmap() {} | 958 ImageBitmap::~ImageBitmap() {} |
| 959 | 959 |
| 960 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, | 960 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, |
| 961 Optional<IntRect> cropRect, | 961 Optional<IntRect> cropRect, |
| 962 Document* document, | 962 Document* document, |
| 963 const ImageBitmapOptions& options) { | 963 const ImageBitmapOptions& options) { |
| 964 return new ImageBitmap(image, cropRect, document, options); | 964 return new ImageBitmap(image, cropRect, document, options); |
| 965 } | 965 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, | 1095 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, |
| 1096 FloatRect* dstRect) const {} | 1096 FloatRect* dstRect) const {} |
| 1097 | 1097 |
| 1098 FloatSize ImageBitmap::elementSize(const FloatSize&) const { | 1098 FloatSize ImageBitmap::elementSize(const FloatSize&) const { |
| 1099 return FloatSize(width(), height()); | 1099 return FloatSize(width(), height()); |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 DEFINE_TRACE(ImageBitmap) {} | 1102 DEFINE_TRACE(ImageBitmap) {} |
| 1103 | 1103 |
| 1104 } // namespace blink | 1104 } // namespace blink |
| OLD | NEW |