/work/obj-fuzz/dist/include/mozilla/layers/CompositableTransactionParent.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef MOZILLA_LAYERS_COMPOSITABLETRANSACTIONPARENT_H |
8 | | #define MOZILLA_LAYERS_COMPOSITABLETRANSACTIONPARENT_H |
9 | | |
10 | | #include <vector> // for vector |
11 | | #include "mozilla/Attributes.h" // for override |
12 | | #include "mozilla/NotNull.h" |
13 | | #include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator |
14 | | #include "mozilla/layers/LayersMessages.h" // for EditReply, etc |
15 | | #include "mozilla/layers/TextureClient.h" |
16 | | #include "CompositableHost.h" |
17 | | |
18 | | namespace mozilla { |
19 | | namespace layers { |
20 | | |
21 | | // Since PCompositble has two potential manager protocols, we can't just call |
22 | | // the Manager() method usually generated when there's one manager protocol, |
23 | | // so both manager protocols implement this and we keep a reference to them |
24 | | // through this interface. |
25 | | class CompositableParentManager : public HostIPCAllocator |
26 | | { |
27 | | public: |
28 | | |
29 | 0 | CompositableParentManager() {} |
30 | | |
31 | | void DestroyActor(const OpDestroy& aOp); |
32 | | |
33 | | void UpdateFwdTransactionId(uint64_t aTransactionId) |
34 | 0 | { |
35 | 0 | MOZ_ASSERT(mFwdTransactionId < aTransactionId); |
36 | 0 | mFwdTransactionId = aTransactionId; |
37 | 0 | } |
38 | | |
39 | 0 | uint64_t GetFwdTransactionId() { return mFwdTransactionId; } |
40 | | |
41 | | RefPtr<CompositableHost> AddCompositable( |
42 | | const CompositableHandle& aHandle, |
43 | | const TextureInfo& aInfo, |
44 | | bool aUseWebRender); |
45 | | RefPtr<CompositableHost> FindCompositable(const CompositableHandle& aHandle); |
46 | | |
47 | | protected: |
48 | | /** |
49 | | * Handle the IPDL messages that affect PCompositable actors. |
50 | | */ |
51 | | bool ReceiveCompositableUpdate(const CompositableOperation& aEdit); |
52 | | bool ReceiveCompositableUpdate(const CompositableOperationDetail& aDetail, |
53 | | NotNull<CompositableHost*> aCompositable); |
54 | | |
55 | | void ReleaseCompositable(const CompositableHandle& aHandle); |
56 | | |
57 | | uint64_t mFwdTransactionId = 0; |
58 | | |
59 | | /** |
60 | | * Mapping form IDs to CompositableHosts. |
61 | | */ |
62 | | std::map<uint64_t, RefPtr<CompositableHost>> mCompositables; |
63 | | |
64 | | }; |
65 | | |
66 | | } // namespace layers |
67 | | } // namespace mozilla |
68 | | |
69 | | #endif |