• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // TextureImpl_mock.h: Defines a mock of the TextureImpl class.
8 
9 #ifndef LIBANGLE_RENDERER_TEXTUREIMPLMOCK_H_
10 #define LIBANGLE_RENDERER_TEXTUREIMPLMOCK_H_
11 
12 #include "gmock/gmock.h"
13 
14 #include "libANGLE/renderer/TextureImpl.h"
15 
16 namespace rx
17 {
18 
19 class MockTextureImpl : public TextureImpl
20 {
21   public:
MockTextureImpl()22     MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {}
~MockTextureImpl()23     virtual ~MockTextureImpl() { destructor(); }
24     MOCK_METHOD9(setImage,
25                  angle::Result(const gl::Context *,
26                                const gl::ImageIndex &,
27                                GLenum,
28                                const gl::Extents &,
29                                GLenum,
30                                GLenum,
31                                const gl::PixelUnpackState &,
32                                gl::Buffer *,
33                                const uint8_t *));
34     MOCK_METHOD8(setSubImage,
35                  angle::Result(const gl::Context *,
36                                const gl::ImageIndex &,
37                                const gl::Box &,
38                                GLenum,
39                                GLenum,
40                                const gl::PixelUnpackState &,
41                                gl::Buffer *,
42                                const uint8_t *));
43     MOCK_METHOD7(setCompressedImage,
44                  angle::Result(const gl::Context *,
45                                const gl::ImageIndex &,
46                                GLenum,
47                                const gl::Extents &,
48                                const gl::PixelUnpackState &,
49                                size_t,
50                                const uint8_t *));
51     MOCK_METHOD7(setCompressedSubImage,
52                  angle::Result(const gl::Context *,
53                                const gl::ImageIndex &,
54                                const gl::Box &,
55                                GLenum,
56                                const gl::PixelUnpackState &,
57                                size_t,
58                                const uint8_t *));
59     MOCK_METHOD5(copyImage,
60                  angle::Result(const gl::Context *,
61                                const gl::ImageIndex &,
62                                const gl::Rectangle &,
63                                GLenum,
64                                gl::Framebuffer *));
65     MOCK_METHOD5(copySubImage,
66                  angle::Result(const gl::Context *,
67                                const gl::ImageIndex &,
68                                const gl::Offset &,
69                                const gl::Rectangle &,
70                                gl::Framebuffer *));
71     MOCK_METHOD9(copyTexture,
72                  angle::Result(const gl::Context *,
73                                const gl::ImageIndex &,
74                                GLenum,
75                                GLenum,
76                                size_t,
77                                bool,
78                                bool,
79                                bool,
80                                const gl::Texture *));
81     MOCK_METHOD9(copySubTexture,
82                  angle::Result(const gl::Context *,
83                                const gl::ImageIndex &,
84                                const gl::Offset &,
85                                size_t,
86                                const gl::Box &,
87                                bool,
88                                bool,
89                                bool,
90                                const gl::Texture *));
91     MOCK_METHOD2(copyCompressedTexture,
92                  angle::Result(const gl::Context *, const gl::Texture *source));
93     MOCK_METHOD5(
94         setStorage,
95         angle::Result(const gl::Context *, gl::TextureType, size_t, GLenum, const gl::Extents &));
96     MOCK_METHOD7(setStorageExternalMemory,
97                  angle::Result(const gl::Context *,
98                                gl::TextureType,
99                                size_t,
100                                GLenum,
101                                const gl::Extents &,
102                                gl::MemoryObject *,
103                                GLuint64));
104     MOCK_METHOD4(setImageExternal,
105                  angle::Result(const gl::Context *,
106                                gl::TextureType,
107                                egl::Stream *,
108                                const egl::Stream::GLTextureDescription &));
109     MOCK_METHOD3(setEGLImageTarget,
110                  angle::Result(const gl::Context *, gl::TextureType, egl::Image *));
111     MOCK_METHOD1(generateMipmap, angle::Result(const gl::Context *));
112     MOCK_METHOD2(bindTexImage, angle::Result(const gl::Context *, egl::Surface *));
113     MOCK_METHOD1(releaseTexImage, angle::Result(const gl::Context *));
114 
115     MOCK_METHOD5(getAttachmentRenderTarget,
116                  angle::Result(const gl::Context *,
117                                GLenum,
118                                const gl::ImageIndex &,
119                                GLsizei,
120                                FramebufferAttachmentRenderTarget **));
121 
122     MOCK_METHOD6(setStorageMultisample,
123                  angle::Result(const gl::Context *,
124                                gl::TextureType,
125                                GLsizei,
126                                GLint,
127                                const gl::Extents &,
128                                bool));
129 
130     MOCK_METHOD2(setBaseLevel, angle::Result(const gl::Context *, GLuint));
131 
132     MOCK_METHOD2(syncState, angle::Result(const gl::Context *, const gl::Texture::DirtyBits &));
133 
134     MOCK_METHOD0(destructor, void());
135 
136   protected:
137     gl::TextureState mMockState;
138 };
139 }  // namespace rx
140 
141 #endif  // LIBANGLE_RENDERER_TEXTUREIMPLMOCK_H_
142