Index: sky/engine/core/painting/CanvasImage.cpp |
diff --git a/sky/engine/core/painting/CanvasImage.cpp b/sky/engine/core/painting/CanvasImage.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c55e9984f04bce6951270c4d0463fb0deb1c4285 |
--- /dev/null |
+++ b/sky/engine/core/painting/CanvasImage.cpp |
@@ -0,0 +1,45 @@ |
+// 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. |
+ |
+#include "sky/engine/config.h" |
+#include "sky/engine/core/painting/CanvasImage.h" |
+ |
+namespace blink { |
+ |
+CanvasImage::CanvasImage() |
+ : m_imageLoader(NewImageLoader::create(this)) |
+{ |
+ |
+} |
+ |
+CanvasImage::~CanvasImage() |
+{ |
+} |
+ |
+int CanvasImage::width() const |
+{ |
+ return m_bitmap.width(); |
+} |
+ |
+int CanvasImage::height() const |
+{ |
+ return m_bitmap.height(); |
+} |
+ |
+void CanvasImage::setSrc(const String& url) |
+{ |
+ KURL newSrcURL = KURL(KURL(), url); |
+ if (m_srcURL != newSrcURL) |
+ { |
eseidel
2015/05/29 22:13:51
{ on the same line as the if in both Blink and Chr
|
+ m_srcURL = newSrcURL; |
+ m_imageLoader->load(m_srcURL); |
+ } |
+} |
+ |
+void CanvasImage::notifyLoadFinished(const SkBitmap& result) |
+{ |
+ m_bitmap = result; |
+} |
+ |
+} |