forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtiled_texture_contents.h
More file actions
45 lines (32 loc) · 1.22 KB
/
tiled_texture_contents.h
File metadata and controls
45 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <functional>
#include <memory>
#include <vector>
#include "flutter/fml/macros.h"
#include "impeller/entity/contents/color_source_contents.h"
#include "impeller/entity/entity.h"
#include "impeller/geometry/path.h"
#include "impeller/renderer/sampler_descriptor.h"
namespace impeller {
class TiledTextureContents final : public ColorSourceContents {
public:
TiledTextureContents();
~TiledTextureContents() override;
// |Contents|
bool Render(const ContentContext& renderer,
const Entity& entity,
RenderPass& pass) const override;
void SetTexture(std::shared_ptr<Texture> texture);
void SetTileModes(Entity::TileMode x_tile_mode, Entity::TileMode y_tile_mode);
void SetSamplerDescriptor(SamplerDescriptor desc);
private:
std::shared_ptr<Texture> texture_;
SamplerDescriptor sampler_descriptor_ = {};
Entity::TileMode x_tile_mode_ = Entity::TileMode::kClamp;
Entity::TileMode y_tile_mode_ = Entity::TileMode::kClamp;
FML_DISALLOW_COPY_AND_ASSIGN(TiledTextureContents);
};
} // namespace impeller