| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StaticBitmapImage_h | 5 #ifndef StaticBitmapImage_h |
| 6 #define StaticBitmapImage_h | 6 #define StaticBitmapImage_h |
| 7 | 7 |
| 8 #include "platform/graphics/Image.h" | 8 #include "platform/graphics/Image.h" |
| 9 #include "public/platform/WebExternalTextureMailbox.h" |
| 9 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 | 12 |
| 12 class PLATFORM_EXPORT StaticBitmapImage final : public Image { | 13 class PLATFORM_EXPORT StaticBitmapImage final : public Image { |
| 13 public: | 14 public: |
| 14 ~StaticBitmapImage() override; | 15 ~StaticBitmapImage() override; |
| 15 | 16 |
| 16 bool currentFrameIsComplete() override { return true; } | 17 bool currentFrameIsComplete() override { return true; } |
| 17 | 18 |
| 18 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>); | 19 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>); |
| 20 static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&); |
| 19 virtual void destroyDecodedData(bool destroyAll) { } | 21 virtual void destroyDecodedData(bool destroyAll) { } |
| 20 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata); | 22 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata); |
| 21 virtual IntSize size() const; | 23 virtual IntSize size() const; |
| 22 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, RespectImageOrientationEnum, ImageClampingMode) override; | 24 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, RespectImageOrientationEnum, ImageClampingMode) override; |
| 23 | 25 |
| 24 PassRefPtr<SkImage> imageForCurrentFrame() override; | 26 PassRefPtr<SkImage> imageForCurrentFrame() override; |
| 25 | 27 |
| 26 bool originClean() const { return m_isOriginClean; } | 28 bool originClean() const { return m_isOriginClean; } |
| 27 void setOriginClean(bool flag) { m_isOriginClean = flag; } | 29 void setOriginClean(bool flag) { m_isOriginClean = flag; } |
| 28 bool isPremultiplied() const { return m_isPremultiplied; } | 30 bool isPremultiplied() const { return m_isPremultiplied; } |
| 29 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } | 31 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } |
| 30 protected: | 32 protected: |
| 31 StaticBitmapImage(PassRefPtr<SkImage>); | 33 StaticBitmapImage(PassRefPtr<SkImage>); |
| 34 StaticBitmapImage(WebExternalTextureMailbox&); |
| 32 | 35 |
| 33 RefPtr<SkImage> m_image; | 36 RefPtr<SkImage> m_image; |
| 37 WebExternalTextureMailbox m_mailbox; |
| 34 bool m_isOriginClean = true; | 38 bool m_isOriginClean = true; |
| 35 // The premultiply info is stored here because the SkImage API | 39 // The premultiply info is stored here because the SkImage API |
| 36 // doesn't expose this info. | 40 // doesn't expose this info. |
| 37 bool m_isPremultiplied = true; | 41 bool m_isPremultiplied = true; |
| 38 }; | 42 }; |
| 39 | 43 |
| 40 } // namespace blink | 44 } // namespace blink |
| 41 | 45 |
| 42 #endif | 46 #endif |
| OLD | NEW |