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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/MailboxTextureHolder.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 MailboxTextureHolder_h
6 #define MailboxTextureHolder_h
7
8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/TextureHolder.h"
10 #include "third_party/khronos/GLES2/gl2.h"
11 #include "wtf/WeakPtr.h"
12
13 namespace gpu {
14 namespace gles2 {
15 class GLES2Interface;
16 }
17 }
18
19 namespace blink {
20
21 class DrawingBuffer;
22
23 class PLATFORM_EXPORT MailboxTextureHolder final : public TextureHolder {
24 public:
25 ~MailboxTextureHolder() override;
26
27 bool isSkiaTextureHolder() final { return false; }
28 bool isMailboxTextureHolder() final { return true; }
29 unsigned sharedContextId() final;
30 WebThread* imageThread() final;
31 IntSize size() const final { return m_size; }
32
33 gpu::Mailbox mailbox() final { return m_mailbox; }
34 gpu::SyncToken syncToken() final { return m_syncToken; }
35 void updateSyncToken(gpu::SyncToken syncToken) final {
36 m_syncToken = syncToken;
37 }
38
39 // In WebGL's commit or transferToImageBitmap calls, it will call the
40 // DrawingBuffer::transferToStaticBitmapImage function, which produces the
41 // input parameters for this method.
42 MailboxTextureHolder(const gpu::Mailbox&,
43 const gpu::SyncToken&,
44 unsigned textureIdToDeleteAfterMailboxConsumed,
45 WeakPtr<DrawingBuffer>,
46 IntSize mailboxSize);
47 // This function turns a texture-backed SkImage into a mailbox and a
48 // syncToken.
49 MailboxTextureHolder(std::unique_ptr<TextureHolder>);
50
51 private:
52 gpu::Mailbox m_mailbox;
53 gpu::SyncToken m_syncToken;
54 unsigned m_textureId;
55 WeakPtr<DrawingBuffer> m_drawingBuffer;
56 IntSize m_size;
57 bool m_isConvertedFromSkiaTexture;
58 };
59
60 } // namespace blink
61
62 #endif // MailboxTextureHolder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698