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 #include "sky/engine/config.h" | |
6 #include "sky/engine/core/painting/CanvasImage.h" | |
7 | |
8 namespace blink { | |
9 | |
10 CanvasImage::CanvasImage() | |
11 : m_imageLoader(NewImageLoader::create(this)) | |
12 { | |
13 | |
14 } | |
15 | |
16 CanvasImage::~CanvasImage() | |
17 { | |
18 } | |
19 | |
20 int CanvasImage::width() const | |
21 { | |
22 return m_bitmap.width(); | |
23 } | |
24 | |
25 int CanvasImage::height() const | |
26 { | |
27 return m_bitmap.height(); | |
28 } | |
29 | |
30 void CanvasImage::setSrc(const String& url) | |
31 { | |
32 KURL newSrcURL = KURL(KURL(), url); | |
33 if (m_srcURL != newSrcURL) | |
34 { | |
eseidel
2015/05/29 22:13:51
{ on the same line as the if in both Blink and Chr
| |
35 m_srcURL = newSrcURL; | |
36 m_imageLoader->load(m_srcURL); | |
37 } | |
38 } | |
39 | |
40 void CanvasImage::notifyLoadFinished(const SkBitmap& result) | |
41 { | |
42 m_bitmap = result; | |
43 } | |
44 | |
45 } | |
OLD | NEW |