Index: sky/engine/core/painting/CanvasImage.h |
diff --git a/sky/engine/core/painting/CanvasImage.h b/sky/engine/core/painting/CanvasImage.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cd8421717f3cee8e5716e122ae64c49d7803d42d |
--- /dev/null |
+++ b/sky/engine/core/painting/CanvasImage.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ |
+#define SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ |
+ |
+#include "sky/engine/core/loader/NewImageLoader.h" |
+#include "sky/engine/platform/weborigin/KURL.h" |
+#include "sky/engine/tonic/dart_wrappable.h" |
+#include "sky/engine/wtf/PassRefPtr.h" |
+#include "sky/engine/wtf/text/AtomicString.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
+ |
+namespace blink { |
+ |
+class CanvasImage final : public RefCounted<CanvasImage>, public DartWrappable, public NewImageLoaderClient { |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ ~CanvasImage() override; |
+ static PassRefPtr<CanvasImage> create() |
+ { |
+ return adoptRef(new CanvasImage); |
+ } |
+ |
+ int width() const; |
+ int height() const; |
+ |
+ KURL src() const { return m_srcURL; } |
+ void setSrc(const String&); |
+ |
+ SkBitmap bitmap() const { return m_bitmap; } |
+ void setBitmap(const SkBitmap &bitmap) { m_bitmap = bitmap; } |
eseidel
2015/05/29 22:13:51
& attaches to the type in both Blink and Chromium
|
+ |
+private: |
+ CanvasImage(); |
+ |
+ // NewImageLoaderClient |
+ void notifyLoadFinished(const SkBitmap& result); |
+ |
+ KURL m_srcURL; |
+ |
+ SkBitmap m_bitmap; |
+ |
+ OwnPtr<NewImageLoader> m_imageLoader; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ |