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

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

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: deleteTexture in desctructor 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
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 "gpu/command_buffer/common/mailbox.h" 8 #include "gpu/command_buffer/common/mailbox.h"
9 #include "gpu/command_buffer/common/sync_token.h" 9 #include "gpu/command_buffer/common/sync_token.h"
10 #include "platform/graphics/Image.h" 10 #include "platform/graphics/Image.h"
(...skipping 20 matching lines...) Expand all
31 const FloatRect& srcRect, 31 const FloatRect& srcRect,
32 RespectImageOrientationEnum, 32 RespectImageOrientationEnum,
33 ImageClampingMode) override; 33 ImageClampingMode) override;
34 34
35 sk_sp<SkImage> imageForCurrentFrame() override; 35 sk_sp<SkImage> imageForCurrentFrame() override;
36 36
37 bool originClean() const { return m_isOriginClean; } 37 bool originClean() const { return m_isOriginClean; }
38 void setOriginClean(bool flag) { m_isOriginClean = flag; } 38 void setOriginClean(bool flag) { m_isOriginClean = flag; }
39 bool isPremultiplied() const { return m_isPremultiplied; } 39 bool isPremultiplied() const { return m_isPremultiplied; }
40 void setPremultiplied(bool flag) { m_isPremultiplied = flag; } 40 void setPremultiplied(bool flag) { m_isPremultiplied = flag; }
41 // In our current design, the SkImage in this class is always *not*
42 // texture-backed.
41 bool isTextureBacked() override; 43 bool isTextureBacked() override;
42 virtual void copyToTexture(WebGraphicsContext3DProvider*, 44 virtual void copyToTexture(WebGraphicsContext3DProvider*,
43 GLuint, 45 GLuint,
44 GLenum, 46 GLenum,
45 GLenum, 47 GLenum,
46 bool) { 48 bool) {
47 NOTREACHED(); 49 NOTREACHED();
48 } 50 }
49 virtual bool hasMailbox() { return false; } 51 virtual bool hasMailbox() { return false; }
50 virtual void transfer() {} 52 virtual void transfer() {}
51 53
54 virtual void ensureMailbox() {}
52 virtual gpu::Mailbox getMailbox() { return gpu::Mailbox(); } 55 virtual gpu::Mailbox getMailbox() { return gpu::Mailbox(); }
53 virtual gpu::SyncToken getSyncToken() { return gpu::SyncToken(); } 56 virtual gpu::SyncToken getSyncToken() { return gpu::SyncToken(); }
54 virtual void ensureMailbox() {} 57 virtual void updateSyncToken(gpu::SyncToken) {}
55 58
56 protected: 59 protected:
57 StaticBitmapImage(sk_sp<SkImage>);
58 StaticBitmapImage(); // empty constructor for derived class. 60 StaticBitmapImage(); // empty constructor for derived class.
59 sk_sp<SkImage> m_image; 61 sk_sp<SkImage> m_image;
Justin Novosad 2016/10/28 21:58:41 I find it clumsy that AcceleratedStaticBitmapImage
60 62
61 private: 63 private:
64 StaticBitmapImage(sk_sp<SkImage>);
62 bool m_isOriginClean = true; 65 bool m_isOriginClean = true;
63 // The premultiply info is stored here because the SkImage API 66 // The premultiply info is stored here because the SkImage API
64 // doesn't expose this info. 67 // doesn't expose this info.
65 bool m_isPremultiplied = true; 68 bool m_isPremultiplied = true;
66 }; 69 };
67 70
68 } // namespace blink 71 } // namespace blink
69 72
70 #endif 73 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698