/work/obj-fuzz/dist/include/mozilla/webrender/RenderTextureHost.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_GFX_RENDERTEXTUREHOST_H |
8 | | #define MOZILLA_GFX_RENDERTEXTUREHOST_H |
9 | | |
10 | | #include "GLConsts.h" |
11 | | #include "nsISupportsImpl.h" |
12 | | #include "mozilla/gfx/2D.h" |
13 | | #include "mozilla/layers/LayersSurfaces.h" |
14 | | #include "mozilla/RefPtr.h" |
15 | | #include "mozilla/webrender/webrender_ffi.h" // for wr::ImageRendering |
16 | | |
17 | | namespace mozilla { |
18 | | |
19 | | namespace gl { |
20 | | class GLContext; |
21 | | } |
22 | | |
23 | | namespace wr { |
24 | | |
25 | | class RenderBufferTextureHost; |
26 | | class RenderTextureHostOGL; |
27 | | class RenderTextureHostWrapper; |
28 | | |
29 | | void |
30 | | ActivateBindAndTexParameteri(gl::GLContext* aGL, |
31 | | GLenum aActiveTexture, |
32 | | GLenum aBindTarget, |
33 | | GLuint aBindTexture, |
34 | | wr::ImageRendering aRendering); |
35 | | |
36 | | class RenderTextureHost |
37 | | { |
38 | | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RenderTextureHost) |
39 | | |
40 | | public: |
41 | | RenderTextureHost(); |
42 | | |
43 | | virtual wr::WrExternalImage Lock(uint8_t aChannelIndex, |
44 | | gl::GLContext* aGL, |
45 | | wr::ImageRendering aRendering) = 0; |
46 | | virtual void Unlock() = 0; |
47 | 0 | virtual void ClearCachedResources() {} |
48 | | |
49 | 0 | virtual RenderTextureHostWrapper* AsRenderTextureHostWrapper() { return nullptr; } |
50 | | |
51 | | protected: |
52 | | virtual ~RenderTextureHost(); |
53 | | |
54 | | bool IsFilterUpdateNecessary(wr::ImageRendering aRendering); |
55 | | |
56 | | wr::ImageRendering mCachedRendering; |
57 | | }; |
58 | | |
59 | | } // namespace wr |
60 | | } // namespace mozilla |
61 | | |
62 | | #endif // MOZILLA_GFX_RENDERTEXTUREHOST_H |