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..3f616b345b7b28ea6e964c4a45b02997c2143842 |
--- /dev/null |
+++ b/sky/engine/core/painting/CanvasImage.cpp |
@@ -0,0 +1,29 @@ |
+// 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 { |
+ |
+int CanvasImage::width() const { |
+ return bitmap_.width(); |
+} |
+ |
+int CanvasImage::height() const { |
+ return bitmap_.height(); |
+} |
+ |
+void CanvasImage::setSrc(const String& url) { |
+ KURL newSrcURL = KURL(KURL(), url); |
abarth-chromium
2015/05/29 23:04:11
Please add a TODO comment about using the proper b
jackson
2015/05/29 23:35:44
Acknowledged.
|
+ if (srcURL_ != newSrcURL) { |
+ srcURL_ = newSrcURL; |
+ imageLoader_->Load(srcURL_); |
+ } |
+} |
+ |
+void CanvasImage::notifyLoadFinished(const SkBitmap& result) { |
+ bitmap_ = result; |
abarth-chromium
2015/05/29 23:04:11
We'll eventually need a notification pathway for w
jackson
2015/05/29 23:35:44
Acknowledged.
|
+} |
+} |
abarth-chromium
2015/05/29 23:04:10
} // namespace blink
|