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
28 bool Overwrite(Context& gpu_context,
29 const tonic::DartByteData& source_bytes,
30 uint32_t mip_level,
31 uint32_t slice);
32
33 Dart_Handle AsImage() const;
34
35 private:
36 std::shared_ptr<impeller::Texture> texture_;
37
39};
40
41} // namespace gpu
42} // namespace flutter
43
44//----------------------------------------------------------------------------
45/// Exports
46///
47
48extern "C" {
49
52 Dart_Handle wrapper,
53 flutter::gpu::Context* gpu_context,
54 int storage_mode,
55 int format,
56 int width,
57 int height,
58 int sample_count,
59 int texture_type,
60 bool enable_render_target_usage,
61 bool enable_shader_read_usage,
62 bool enable_shader_write_usage,
63 int mip_level_count);
64
67 flutter::gpu::Texture* wrapper,
68 flutter::gpu::Context* gpu_context,
69 Dart_Handle source_byte_data,
70 int mip_level,
71 int slice);
72
74extern Dart_Handle InternalFlutterGpu_Texture_AsImage(
75 flutter::gpu::Texture* wrapper);
76
77} // extern "C"
78
79#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:86
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:38
Dart_Handle AsImage() const
Definition texture.cc:143
#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:238
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 texture_type, bool enable_render_target_usage, bool enable_shader_read_usage, bool enable_shader_write_usage, int mip_level_count)
Definition texture.cc:165
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:225
FlTexture * texture
#define FML_FRIEND_MAKE_REF_COUNTED(T)
int32_t height
int32_t width