| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebImage.h" | 32 #include "WebImage.h" |
| 33 | 33 |
| 34 #include "WebData.h" | 34 #include "WebData.h" |
| 35 #include "WebSize.h" | 35 #include "WebSize.h" |
| 36 | 36 |
| 37 #include "Image.h" |
| 37 #include "ImageSourceSkia.h" | 38 #include "ImageSourceSkia.h" |
| 38 #include "NativeImageSkia.h" | 39 #include "NativeImageSkia.h" |
| 39 #include "SharedBuffer.h" | 40 #include "SharedBuffer.h" |
| 40 #include <wtf/OwnPtr.h> | 41 #include <wtf/OwnPtr.h> |
| 41 #include <wtf/PassRefPtr.h> | 42 #include <wtf/PassRefPtr.h> |
| 42 | 43 |
| 43 using namespace WebCore; | 44 using namespace WebCore; |
| 44 | 45 |
| 45 namespace WebKit { | 46 namespace WebKit { |
| 46 | 47 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 71 bool WebImage::isNull() const | 72 bool WebImage::isNull() const |
| 72 { | 73 { |
| 73 return m_bitmap.isNull(); | 74 return m_bitmap.isNull(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 WebSize WebImage::size() const | 77 WebSize WebImage::size() const |
| 77 { | 78 { |
| 78 return WebSize(m_bitmap.width(), m_bitmap.height()); | 79 return WebSize(m_bitmap.width(), m_bitmap.height()); |
| 79 } | 80 } |
| 80 | 81 |
| 82 WebImage::WebImage(const PassRefPtr<Image>& image) |
| 83 { |
| 84 operator=(image); |
| 85 } |
| 86 |
| 87 WebImage& WebImage::operator=(const PassRefPtr<Image>& image) |
| 88 { |
| 89 NativeImagePtr p; |
| 90 if (image.get() && (p = image->nativeImageForCurrentFrame())) |
| 91 assign(*p); |
| 92 else |
| 93 reset(); |
| 94 return *this; |
| 95 } |
| 96 |
| 81 } // namespace WebKit | 97 } // namespace WebKit |
| OLD | NEW |