Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/ImageBitmap.h |
| diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.h b/third_party/WebKit/Source/core/frame/ImageBitmap.h |
| index 8dc3a51e7070dd73fd00cf08973306fd253b6a49..13086aa93a4be97d26c6d2197dc7e29dfa30899b 100644 |
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.h |
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.h |
| @@ -12,6 +12,7 @@ |
| #include "platform/geometry/IntRect.h" |
| #include "platform/graphics/Image.h" |
| #include "platform/heap/Handle.h" |
| +#include "third_party/skia/include/core/SkImage.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefCounted.h" |
| @@ -32,14 +33,10 @@ public: |
| static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageBitmap*, const IntRect&); |
| static PassRefPtrWillBeRawPtr<ImageBitmap> create(Image*, const IntRect&); |
| - PassRefPtr<Image> bitmapImage() const; |
| - PassRefPtrWillBeRawPtr<HTMLImageElement> imageElement() const { return m_imageElement; } |
| - |
| - IntRect bitmapRect() const { return m_bitmapRect; } |
| - |
| - int width() const { return m_cropRect.width(); } |
| - int height() const { return m_cropRect.height(); } |
| - IntSize size() const { return m_cropRect.size(); } |
| + SkImage* skImage() const { return (m_image) ? m_image.get() : nullptr; } |
| + int width() const { return (m_image) ? m_image->width(): 0; } |
| + int height() const { return (m_image) ? m_image->height(): 0; } |
| + IntSize size() const { return (m_image) ? IntSize(m_image->width(), m_image->height()) : IntSize(); } |
| ~ImageBitmap() override; |
| @@ -63,19 +60,7 @@ private: |
| void notifyImageSourceChanged() override; |
| bool requestsHighLiveResourceCachePriority() override { return true; } |
| - // ImageBitmaps constructed from HTMLImageElements hold a reference to the HTMLImageElement until |
| - // the image source changes. |
| - RefPtrWillBeMember<HTMLImageElement> m_imageElement; |
| - RefPtr<Image> m_bitmap; |
| - |
| - IntRect m_bitmapRect; // The rect where the underlying Image should be placed in reference to the ImageBitmap. |
| - IntRect m_cropRect; |
| - |
| - // The offset by which the desired Image is stored internally. |
| - // ImageBitmaps constructed from HTMLImageElements reference the entire ImageResource and may have a non-zero bitmap offset. |
| - // ImageBitmaps not constructed from HTMLImageElements always pre-crop and store the image at (0, 0). |
| - IntPoint m_bitmapOffset; |
| - |
| + RefPtr<SkImage> m_image; |
|
Justin Novosad
2015/11/02 15:53:19
This is great, you reduced it to just one field. T
|
| }; |
| } // namespace blink |