| 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 "platform/graphics/skia/SkiaUtils.h" | 10 #include "platform/graphics/skia/SkiaUtils.h" |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) | 584 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) |
| 585 { | 585 { |
| 586 m_image = image; | 586 m_image = image; |
| 587 } | 587 } |
| 588 | 588 |
| 589 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() | 589 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() |
| 590 { | 590 { |
| 591 ASSERT(!isNeutered()); | 591 ASSERT(!isNeutered()); |
| 592 m_isNeutered = true; | 592 m_isNeutered = true; |
| 593 m_image->transfer(); |
| 593 return m_image.release(); | 594 return m_image.release(); |
| 594 } | 595 } |
| 595 | 596 |
| 596 ImageBitmap::~ImageBitmap() | 597 ImageBitmap::~ImageBitmap() |
| 597 { | 598 { |
| 598 } | 599 } |
| 599 | 600 |
| 600 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop
Rect, Document* document, const ImageBitmapOptions& options) | 601 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop
Rect, Document* document, const ImageBitmapOptions& options) |
| 601 { | 602 { |
| 602 return new ImageBitmap(image, cropRect, document, options); | 603 return new ImageBitmap(image, cropRect, document, options); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 FloatSize ImageBitmap::elementSize(const FloatSize&) const | 711 FloatSize ImageBitmap::elementSize(const FloatSize&) const |
| 711 { | 712 { |
| 712 return FloatSize(width(), height()); | 713 return FloatSize(width(), height()); |
| 713 } | 714 } |
| 714 | 715 |
| 715 DEFINE_TRACE(ImageBitmap) | 716 DEFINE_TRACE(ImageBitmap) |
| 716 { | 717 { |
| 717 } | 718 } |
| 718 | 719 |
| 719 } // namespace blink | 720 } // namespace blink |
| OLD | NEW |