| Index: webkit/api/src/WebImageCG.cpp
|
| ===================================================================
|
| --- webkit/api/src/WebImageCG.cpp (revision 20148)
|
| +++ webkit/api/src/WebImageCG.cpp (working copy)
|
| @@ -36,6 +36,7 @@
|
| #include "WebData.h"
|
| #include "WebSize.h"
|
|
|
| +#include "Image.h"
|
| #include "ImageSource.h"
|
| #include "SharedBuffer.h"
|
| #include <wtf/PassRefPtr.h>
|
| @@ -83,6 +84,22 @@
|
| return WebSize(CGImageGetWidth(m_imageRef), CGImageGetHeight(m_imageRef));
|
| }
|
|
|
| +WebImage::WebImage(const PassRefPtr<Image>& image)
|
| + : m_imageRef(0)
|
| +{
|
| + if (image.get())
|
| + assign(image->nativeImageForCurrentFrame());
|
| +}
|
| +
|
| +WebImage& WebImage::operator=(const PassRefPtr<Image>& image)
|
| +{
|
| + if (image.get())
|
| + assign(image->nativeImageForCurrentFrame());
|
| + else
|
| + reset();
|
| + return *this;
|
| +}
|
| +
|
| void WebImage::assign(CGImageRef imageRef)
|
| {
|
| CGImageRelease(m_imageRef);
|
|
|