Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(983)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10
11 namespace blink { 11 namespace blink {
12 12
13 class PLATFORM_EXPORT StaticBitmapImage final : public Image { 13 class PLATFORM_EXPORT StaticBitmapImage final : public Image {
14 public: 14 public:
15 ~StaticBitmapImage() override; 15 ~StaticBitmapImage() override;
16 16
17 bool currentFrameIsComplete() override { return true; } 17 bool currentFrameIsFullyReceived() override { return true; }
18 18
19 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>); 19 static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>);
20 static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&); 20 static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&);
21 virtual void destroyDecodedData() { } 21 virtual void destroyDecodedData() { }
22 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata); 22 virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata);
23 virtual IntSize size() const; 23 virtual IntSize size() const;
24 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;
25 25
26 PassRefPtr<SkImage> imageForCurrentFrame() override; 26 PassRefPtr<SkImage> imageForCurrentFrame() override;
27 27
28 bool originClean() const { return m_isOriginClean; } 28 bool originClean() const { return m_isOriginClean; }
29 void setOriginClean(bool flag) { m_isOriginClean = flag; } 29 void setOriginClean(bool flag) { m_isOriginClean = flag; }
30 bool isPremultiplied() const { return m_isPremultiplied; } 30 bool isPremultiplied() const { return m_isPremultiplied; }
31 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } 31 void setPremultiplied(bool flag) { m_isPremultiplied = flag; }
32 protected: 32 protected:
33 StaticBitmapImage(PassRefPtr<SkImage>); 33 StaticBitmapImage(PassRefPtr<SkImage>);
34 StaticBitmapImage(WebExternalTextureMailbox&); 34 StaticBitmapImage(WebExternalTextureMailbox&);
35 35
36 RefPtr<SkImage> m_image; 36 RefPtr<SkImage> m_image;
37 WebExternalTextureMailbox m_mailbox; 37 WebExternalTextureMailbox m_mailbox;
38 bool m_isOriginClean = true; 38 bool m_isOriginClean = true;
39 // The premultiply info is stored here because the SkImage API 39 // The premultiply info is stored here because the SkImage API
40 // doesn't expose this info. 40 // doesn't expose this info.
41 bool m_isPremultiplied = true; 41 bool m_isPremultiplied = true;
42 }; 42 };
43 43
44 } // namespace blink 44 } // namespace blink
45 45
46 #endif 46 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698