2
* Copyright © 2012 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Kevin DuBois <kevin.dubois@canonical.com>
18
#ifndef MIR_TEST_DOUBLES_MOCK_RENDERABLE_H_
19
#define MIR_TEST_DOUBLES_MOCK_RENDERABLE_H_
21
#include "mir/graphics/renderable.h"
22
#include "mir_test_doubles/mock_graphic_region.h"
23
#include <gmock/gmock.h>
32
class MockRenderable : public graphics::Renderable
36
: region(std::make_shared<MockGraphicRegion>()),
37
comp_resource(std::make_shared<compositor::GraphicBufferCompositorResource>(region))
39
using namespace testing;
40
ON_CALL(*this, texture())
41
.WillByDefault(Return(comp_resource));
43
MOCK_CONST_METHOD0(top_left, geometry::Point());
44
MOCK_CONST_METHOD0(size, geometry::Size());
45
MOCK_CONST_METHOD0(texture, std::shared_ptr<compositor::GraphicBufferCompositorResource>());
46
MOCK_CONST_METHOD0(transformation, glm::mat4());
47
MOCK_CONST_METHOD0(alpha, float());
48
MOCK_CONST_METHOD0(hidden, bool());
50
std::shared_ptr<compositor::GraphicRegion> const region;
51
std::shared_ptr<compositor::GraphicBufferCompositorResource> const comp_resource;
57
#endif /* MIR_TEST_DOUBLES_MOCK_RENDERABLE_H_ */