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