OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ | |
6 #define SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ | |
7 | |
8 #include "sky/engine/core/loader/NewImageLoader.h" | |
9 #include "sky/engine/platform/weborigin/KURL.h" | |
10 #include "sky/engine/tonic/dart_wrappable.h" | |
11 #include "sky/engine/wtf/PassRefPtr.h" | |
12 #include "sky/engine/wtf/text/AtomicString.h" | |
13 #include "third_party/skia/include/core/SkBitmap.h" | |
14 | |
15 namespace blink { | |
16 | |
17 class CanvasImage final : public RefCounted<CanvasImage>, public DartWrappable, public NewImageLoaderClient { | |
18 DEFINE_WRAPPERTYPEINFO(); | |
19 public: | |
20 ~CanvasImage() override; | |
21 static PassRefPtr<CanvasImage> create() | |
22 { | |
23 return adoptRef(new CanvasImage); | |
24 } | |
25 | |
26 int width() const; | |
27 int height() const; | |
28 | |
29 KURL src() const { return m_srcURL; } | |
30 void setSrc(const String&); | |
31 | |
32 SkBitmap bitmap() const { return m_bitmap; } | |
33 void setBitmap(const SkBitmap &bitmap) { m_bitmap = bitmap; } | |
eseidel
2015/05/29 22:13:51
& attaches to the type in both Blink and Chromium
| |
34 | |
35 private: | |
36 CanvasImage(); | |
37 | |
38 // NewImageLoaderClient | |
39 void notifyLoadFinished(const SkBitmap& result); | |
40 | |
41 KURL m_srcURL; | |
42 | |
43 SkBitmap m_bitmap; | |
44 | |
45 OwnPtr<NewImageLoader> m_imageLoader; | |
46 }; | |
47 | |
48 } // namespace blink | |
49 | |
50 #endif // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ | |
OLD | NEW |