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

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

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: WeakPtr, still figuring out why one layout test timed out Created 4 years, 1 month 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UnacceleratedStaticBitmapImage_h
6 #define UnacceleratedStaticBitmapImage_h
7
8 #include "platform/graphics/StaticBitmapImage.h"
9
10 namespace blink {
11
12 class PLATFORM_EXPORT UnacceleratedStaticBitmapImage final
13 : public StaticBitmapImage {
14 public:
15 ~UnacceleratedStaticBitmapImage() override;
16 static PassRefPtr<UnacceleratedStaticBitmapImage> create(sk_sp<SkImage>);
17
18 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override;
19 IntSize size() const override;
20 sk_sp<SkImage> imageForCurrentFrame() override;
21 // In our current design, the SkImage in this class is always *not*
22 // texture-backed.
23 bool isTextureBacked() { return false; }
24
25 void draw(SkCanvas*,
26 const SkPaint&,
27 const FloatRect& dstRect,
28 const FloatRect& srcRect,
29 RespectImageOrientationEnum,
30 ImageClampingMode) override;
31
32 bool originClean() const override { return m_isOriginClean; }
33 void setOriginClean(bool flag) override { m_isOriginClean = flag; }
34 bool isPremultiplied() const override { return m_isPremultiplied; }
35 void setPremultiplied(bool flag) override { m_isPremultiplied = flag; }
36
37 private:
38 UnacceleratedStaticBitmapImage(sk_sp<SkImage>);
39 bool m_isOriginClean = true;
40 // The premultiply info is stored here because the SkImage API
41 // doesn't expose this info.
42 bool m_isPremultiplied = true;
43 sk_sp<SkImage> m_image;
44 };
45
46 } // namespace blink
47
48 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698