| 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 #ifndef ImageBitmap_h | 5 #ifndef ImageBitmap_h |
| 6 #define ImageBitmap_h | 6 #define ImageBitmap_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/html/HTMLImageElement.h" | 9 #include "core/html/HTMLImageElement.h" |
| 10 #include "core/html/canvas/CanvasImageSource.h" | 10 #include "core/html/canvas/CanvasImageSource.h" |
| 11 #include "platform/geometry/IntRect.h" | 11 #include "platform/geometry/IntRect.h" |
| 12 #include "platform/graphics/Image.h" | 12 #include "platform/graphics/Image.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "wtf/PassRefPtr.h" | 14 #include "wtf/PassRefPtr.h" |
| 15 #include "wtf/RefCounted.h" | 15 #include "wtf/RefCounted.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class HTMLCanvasElement; | 19 class HTMLCanvasElement; |
| 20 class ImageData; | 20 class ImageData; |
| 21 | 21 |
| 22 class ImageBitmap final : public RefCounted<ImageBitmap>, public ScriptWrappable
, public ImageLoaderClient, public CanvasImageSource { | 22 class ImageBitmap final : public RefCounted<ImageBitmap>, public ScriptWrappable
, public ImageLoaderClient, public CanvasImageSource { |
| 23 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmap); | |
| 25 public: | 24 public: |
| 26 static PassRefPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&); | 25 static PassRefPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&); |
| 27 static PassRefPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&); | 26 static PassRefPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&); |
| 28 static PassRefPtr<ImageBitmap> create(ImageData*, const IntRect&); | 27 static PassRefPtr<ImageBitmap> create(ImageData*, const IntRect&); |
| 29 static PassRefPtr<ImageBitmap> create(ImageBitmap*, const IntRect&); | 28 static PassRefPtr<ImageBitmap> create(ImageBitmap*, const IntRect&); |
| 30 static PassRefPtr<ImageBitmap> create(Image*, const IntRect&); | 29 static PassRefPtr<ImageBitmap> create(Image*, const IntRect&); |
| 31 | 30 |
| 32 PassRefPtr<Image> bitmapImage() const; | 31 PassRefPtr<Image> bitmapImage() const; |
| 33 PassRefPtr<HTMLImageElement> imageElement() const { return m_imageElement; } | 32 PassRefPtr<HTMLImageElement> imageElement() const { return m_imageElement; } |
| 34 | 33 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // The offset by which the desired Image is stored internally. | 68 // The offset by which the desired Image is stored internally. |
| 70 // ImageBitmaps constructed from HTMLImageElements reference the entire Imag
eResource and may have a non-zero bitmap offset. | 69 // ImageBitmaps constructed from HTMLImageElements reference the entire Imag
eResource and may have a non-zero bitmap offset. |
| 71 // ImageBitmaps not constructed from HTMLImageElements always pre-crop and s
tore the image at (0, 0). | 70 // ImageBitmaps not constructed from HTMLImageElements always pre-crop and s
tore the image at (0, 0). |
| 72 IntPoint m_bitmapOffset; | 71 IntPoint m_bitmapOffset; |
| 73 | 72 |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 } // namespace blink | 75 } // namespace blink |
| 77 | 76 |
| 78 #endif // ImageBitmap_h | 77 #endif // ImageBitmap_h |
| OLD | NEW |