Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
texture.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_LIB_GPU_TEXTURE_H_
6#define FLUTTER_LIB_GPU_TEXTURE_H_
7
13
14namespace flutter {
15namespace gpu {
16
17class Texture : public RefCountedDartWrappable<Texture> {
18 DEFINE_WRAPPERTYPEINFO();
20
21 public:
22 explicit Texture(std::shared_ptr<impeller::Texture> texture);
23
24 ~Texture() override;
25
26 std::shared_ptr<impeller::Texture> GetTexture();
27
29
30 bool Overwrite(Context& gpu_context,
31 const tonic::DartByteData& source_bytes,
32 uint32_t mip_level,
33 uint32_t slice);
34
35 size_t GetBytesPerTexel();
36
37 Dart_Handle AsImage() const;
38
39 private:
40 std::shared_ptr<impeller::Texture> texture_;
41
43};
44
45} // namespace gpu
46} // namespace flutter
47
48//----------------------------------------------------------------------------
49/// Exports
50///
51
52extern "C" {
53
56 Dart_Handle wrapper,
57 flutter::gpu::Context* gpu_context,
58 int storage_mode,
59 int format,
60 int width,
61 int height,
62 int sample_count,
63 int coordinate_system,
64 int texture_type,
65 bool enable_render_target_usage,
66 bool enable_shader_read_usage,
67 bool enable_shader_write_usage,
68 int mip_level_count);
69
72 flutter::gpu::Texture* wrapper,
73 int coordinate_system);
74
77 flutter::gpu::Texture* wrapper,
78 flutter::gpu::Context* gpu_context,
79 Dart_Handle source_byte_data,
80 int mip_level,
81 int slice);
82
85 flutter::gpu::Texture* wrapper);
86
88extern Dart_Handle InternalFlutterGpu_Texture_AsImage(
89 flutter::gpu::Texture* wrapper);
90
91} // extern "C"
92
93#endif // FLUTTER_LIB_GPU_TEXTURE_H_
bool Overwrite(Context &gpu_context, const tonic::DartByteData &source_bytes, uint32_t mip_level, uint32_t slice)
Definition texture.cc:91
size_t GetBytesPerTexel()
Definition texture.cc:148
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:38
Dart_Handle AsImage() const
Definition texture.cc:153
void SetCoordinateSystem(impeller::TextureCoordinateSystem coordinate_system)
Definition texture.cc:42
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
#define FLUTTER_GPU_EXPORT
Definition export.h:13
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_Texture_AsImage(flutter::gpu::Texture *wrapper)
Definition texture.cc:264
FLUTTER_GPU_EXPORT void InternalFlutterGpu_Texture_SetCoordinateSystem(flutter::gpu::Texture *wrapper, int coordinate_system)
Definition texture.cc:239
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Texture_Initialize(Dart_Handle wrapper, flutter::gpu::Context *gpu_context, int storage_mode, int format, int width, int height, int sample_count, int coordinate_system, int texture_type, bool enable_render_target_usage, bool enable_shader_read_usage, bool enable_shader_write_usage, int mip_level_count)
Definition texture.cc:175
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_Texture_Overwrite(flutter::gpu::Texture *wrapper, flutter::gpu::Context *gpu_context, Dart_Handle source_byte_data, int mip_level, int slice)
Definition texture.cc:246
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Texture_BytesPerTexel(flutter::gpu::Texture *wrapper)
Definition texture.cc:259
FlTexture * texture
TextureCoordinateSystem
Definition formats.h:330
#define FML_FRIEND_MAKE_REF_COUNTED(T)
int32_t height
int32_t width