10#include "flutter/fml/trace_event.h"
19 std::shared_ptr<Allocation> backing_store)
21 reactor_(
std::move(reactor)),
24 backing_store_(
std::move(backing_store)) {}
29 reactor_->CollectHandle(handle_);
34uint8_t* DeviceBufferGLES::OnGetContents()
const {
38 return backing_store_->GetBuffer();
42bool DeviceBufferGLES::OnCopyHostBuffer(
const uint8_t*
source,
49 if (
offset + source_range.length > backing_store_->GetLength()) {
53 std::memmove(backing_store_->GetBuffer() +
offset,
54 source + source_range.offset, source_range.length);
67 return GL_ARRAY_BUFFER;
69 return GL_ELEMENT_ARRAY_BUFFER;
79 auto buffer = reactor_->GetGLHandle(handle_);
85 const auto&
gl = reactor_->GetProcTable();
87 gl.BindBuffer(target_type,
buffer.value());
89 if (upload_generation_ != generation_) {
92 gl.BufferData(target_type, backing_store_->GetLength(),
93 backing_store_->GetBuffer(), GL_STATIC_DRAW);
94 upload_generation_ = generation_;
101bool DeviceBufferGLES::SetLabel(
const std::string& label) {
102 reactor_->SetDebugLabel(handle_, label);
107bool DeviceBufferGLES::SetLabel(
const std::string& label, Range range) {
110 return SetLabel(label);
114 return backing_store_->GetBuffer();
119 update_buffer_data) {
120 if (update_buffer_data) {
121 update_buffer_data(backing_store_->GetBuffer(),
122 backing_store_->GetLength());
const char * c_str() const
void Flush(std::optional< Range > range=std::nullopt) const override
DeviceBufferGLES(DeviceBufferDescriptor desc, ReactorGLES::Ref reactor, std::shared_ptr< Allocation > backing_store)
void UpdateBufferData(const std::function< void(uint8_t *, size_t length)> &update_buffer_data)
bool BindAndUploadDataIfNecessary(BindingType type) const
~DeviceBufferGLES() override
const uint8_t * GetBufferData() const
std::shared_ptr< ReactorGLES > Ref
#define FML_UNREACHABLE()
Dart_NativeFunction function
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static GLenum ToTarget(DeviceBufferGLES::BindingType type)
static SkString to_string(int n)
constexpr bool IsDead() const
std::shared_ptr< const fml::Mapping > data
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)