| 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(); | |
| 594 return m_image.release(); | 593 return m_image.release(); |
| 595 } | 594 } |
| 596 | 595 |
| 597 ImageBitmap::~ImageBitmap() | 596 ImageBitmap::~ImageBitmap() |
| 598 { | 597 { |
| 599 } | 598 } |
| 600 | 599 |
| 601 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop
Rect, Document* document, const ImageBitmapOptions& options) | 600 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop
Rect, Document* document, const ImageBitmapOptions& options) |
| 602 { | 601 { |
| 603 return new ImageBitmap(image, cropRect, document, options); | 602 return new ImageBitmap(image, cropRect, document, options); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 FloatSize ImageBitmap::elementSize(const FloatSize&) const | 710 FloatSize ImageBitmap::elementSize(const FloatSize&) const |
| 712 { | 711 { |
| 713 return FloatSize(width(), height()); | 712 return FloatSize(width(), height()); |
| 714 } | 713 } |
| 715 | 714 |
| 716 DEFINE_TRACE(ImageBitmap) | 715 DEFINE_TRACE(ImageBitmap) |
| 717 { | 716 { |
| 718 } | 717 } |
| 719 | 718 |
| 720 } // namespace blink | 719 } // namespace blink |
| OLD | NEW |