Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/Image.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h |
| index 841a2ea4ea92d73524c02e32082db48001097da1..248f7e74d5709460434dd0e5366764d7947f4938 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/Image.h |
| +++ b/third_party/WebKit/Source/platform/graphics/Image.h |
| @@ -28,6 +28,7 @@ |
| #define Image_h |
| #include "platform/PlatformExport.h" |
| +#include "platform/SharedBuffer.h" |
| #include "platform/geometry/IntRect.h" |
| #include "platform/graphics/Color.h" |
| #include "platform/graphics/GraphicsTypes.h" |
| @@ -54,7 +55,6 @@ class FloatRect; |
| class FloatSize; |
| class GraphicsContext; |
| class Length; |
| -class SharedBuffer; |
| class Image; |
| class PLATFORM_EXPORT Image : public RefCounted<Image> { |
| @@ -108,7 +108,7 @@ public: |
| virtual void destroyDecodedData() = 0; |
| - SharedBuffer* data() { return m_encodedImageData.get(); } |
| + virtual PassRefPtr<SharedBuffer> data() { return m_encodedImageData; } |
|
haraken
2016/06/23 01:26:41
Is ScriptStreamer the only reason you want to chan
hajimehoshi
2016/06/23 09:23:13
This change is needed since the child class Bitmap
|
| // Animation begins whenever someone draws the image, so startAnimation() is not normally called. |
| // It will automatically pause once all observers no longer want to render the image anywhere. |
| @@ -171,6 +171,10 @@ protected: |
| SkXfermode::Mode, const FloatSize& repeatSpacing); |
| void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfermode::Mode); |
| + // Releases m_encodedImageData when the subclass can have encoded image data |
| + // in another way. |
| + void resetEncodedImageData() { m_encodedImageData.release(); } |
| + |
| private: |
| RefPtr<SharedBuffer> m_encodedImageData; |
| // TODO(Oilpan): consider having Image on the Oilpan heap and |