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 #include "public/platform/WebExternalTextureMailbox.h" |
10 #include "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class WebGraphicsContext3DProvider; | 14 class WebGraphicsContext3DProvider; |
15 | 15 |
16 class PLATFORM_EXPORT StaticBitmapImage final : public Image { | 16 class PLATFORM_EXPORT StaticBitmapImage final : public Image { |
17 public: | 17 public: |
18 ~StaticBitmapImage() override; | 18 ~StaticBitmapImage() override; |
19 | 19 |
20 bool currentFrameIsComplete() override { return true; } | 20 bool currentFrameIsComplete() override { return true; } |
21 | 21 |
22 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>); | 22 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>); |
23 static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&); | 23 static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&); |
24 virtual void destroyDecodedData() { } | 24 virtual void destroyDecodedData() { } |
25 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata); | 25 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata); |
26 virtual IntSize size() const; | 26 virtual IntSize size() const; |
27 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, RespectImageOrientationEnum, ImageClampingMode) override; | 27 void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRe
ct& srcRect, bool imageSmoothingEnabled, RespectImageOrientationEnum, ImageClamp
ingMode) override; |
28 | 28 |
29 PassRefPtr<SkImage> imageForCurrentFrame() override; | 29 PassRefPtr<SkImage> imageForCurrentFrame() override; |
30 | 30 |
31 bool originClean() const { return m_isOriginClean; } | 31 bool originClean() const { return m_isOriginClean; } |
32 void setOriginClean(bool flag) { m_isOriginClean = flag; } | 32 void setOriginClean(bool flag) { m_isOriginClean = flag; } |
33 bool isPremultiplied() const { return m_isPremultiplied; } | 33 bool isPremultiplied() const { return m_isPremultiplied; } |
34 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } | 34 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } |
35 void copyToTexture(WebGraphicsContext3DProvider*, GLuint, GLenum, GLenum, bo
ol); | 35 void copyToTexture(WebGraphicsContext3DProvider*, GLuint, GLenum, GLenum, bo
ol); |
36 bool isTextureBacked() override; | 36 bool isTextureBacked() override; |
37 bool hasMailbox() { return m_mailbox.textureSize.width != 0 && m_mailbox.tex
tureSize.height != 0; } | 37 bool hasMailbox() { return m_mailbox.textureSize.width != 0 && m_mailbox.tex
tureSize.height != 0; } |
(...skipping 11 matching lines...) Expand all Loading... |
49 WebExternalTextureMailbox m_mailbox; | 49 WebExternalTextureMailbox m_mailbox; |
50 bool m_isOriginClean = true; | 50 bool m_isOriginClean = true; |
51 // The premultiply info is stored here because the SkImage API | 51 // The premultiply info is stored here because the SkImage API |
52 // doesn't expose this info. | 52 // doesn't expose this info. |
53 bool m_isPremultiplied = true; | 53 bool m_isPremultiplied = true; |
54 }; | 54 }; |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
57 | 57 |
58 #endif | 58 #endif |
OLD | NEW |