Removed unused font uploading functionality.
Font textures are handled directly through ImGui. PiperOrigin-RevId: 840259537 Change-Id: I5b6b0dc5d2c1c7066b4a23f0106de34285f40e6c
This commit is contained in:
committed by
Copybara-Service
parent
da36e822a8
commit
6ed9f2be7a
@@ -314,11 +314,6 @@ void FilamentContext::UploadHeightField(const mjModel* model, int id) {
|
||||
object_manager_->UploadHeightField(model, id);
|
||||
}
|
||||
|
||||
void FilamentContext::UploadFont(const uint8_t* pixels, int width, int height,
|
||||
int id) {
|
||||
object_manager_->UploadFont(pixels, width, height, id);
|
||||
}
|
||||
|
||||
double FilamentContext::GetFrameRate() const {
|
||||
utils::FixedCapacityVector<filament::Renderer::FrameInfo> frame_info =
|
||||
renderer_->getFrameInfoHistory(1);
|
||||
|
||||
@@ -51,8 +51,6 @@ class FilamentContext {
|
||||
|
||||
void UploadHeightField(const mjModel* model, int id);
|
||||
|
||||
void UploadFont(const uint8_t* pixels, int width, int height, int id);
|
||||
|
||||
double GetFrameRate() const;
|
||||
|
||||
FilamentContext(const FilamentContext&) = delete;
|
||||
|
||||
@@ -158,9 +158,6 @@ ObjectManager::~ObjectManager() {
|
||||
engine_->destroy(fallback_black_);
|
||||
engine_->destroy(fallback_normal_);
|
||||
engine_->destroy(fallback_orm_);
|
||||
for (auto& iter : fonts_) {
|
||||
engine_->destroy(iter.second);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectManager::UploadMesh(const mjModel* model, int id) {
|
||||
@@ -244,14 +241,6 @@ void ObjectManager::UploadHeightField(const mjModel* model, int id) {
|
||||
CreateIndexBuffer(engine_, model, id, MeshType::kHeightField);
|
||||
}
|
||||
|
||||
void ObjectManager::UploadFont(const uint8_t* pixels, int width, int height,
|
||||
int id) {
|
||||
if (auto iter = fonts_.find(id); iter != fonts_.end()) {
|
||||
engine_->destroy(iter->second);
|
||||
}
|
||||
fonts_[id] = Create2dTexture(engine_, width, height, 4, pixels, false);
|
||||
}
|
||||
|
||||
filament::Material* ObjectManager::GetMaterial(MaterialType type) const {
|
||||
if (type < 0 || type >= kNumMaterials) {
|
||||
mju_error("Invalid material type: %d", type);
|
||||
@@ -286,11 +275,6 @@ const FilamentBuffers* ObjectManager::GetShapeBuffer(ShapeType shape) const {
|
||||
return &shapes_[shape];
|
||||
}
|
||||
|
||||
const filament::Texture* ObjectManager::GetFont(int font_id) const {
|
||||
auto it = fonts_.find(font_id);
|
||||
return it != fonts_.end() ? it->second : nullptr;
|
||||
}
|
||||
|
||||
const filament::Texture* ObjectManager::GetTexture(int tex_id) const {
|
||||
auto it = textures_.find(tex_id);
|
||||
return it != textures_.end() ? it->second : nullptr;
|
||||
|
||||
@@ -78,8 +78,6 @@ class ObjectManager {
|
||||
|
||||
void UploadHeightField(const mjModel* model, int id);
|
||||
|
||||
void UploadFont(const uint8_t* pixels, int width, int height, int id);
|
||||
|
||||
// Returns the filament engine used by the ObjectManager to create filament
|
||||
// objects.
|
||||
filament::Engine* GetEngine() const { return engine_; }
|
||||
@@ -90,7 +88,6 @@ class ObjectManager {
|
||||
const FilamentBuffers* GetMeshBuffer(int data_id) const;
|
||||
const FilamentBuffers* GetShapeBuffer(ShapeType shape) const;
|
||||
const FilamentBuffers* GetHeightFieldBuffer(int hfield_id) const;
|
||||
const filament::Texture* GetFont(int font_id) const;
|
||||
const filament::Texture* GetTexture(int tex_id) const;
|
||||
const filament::Texture* GetTexture(int mat_id, int role) const;
|
||||
const filament::Texture* GetTextureWithFallback(int mat_id, int role) const;
|
||||
@@ -124,7 +121,6 @@ class ObjectManager {
|
||||
std::unordered_map<int, FilamentBuffers> meshes_;
|
||||
std::unordered_map<int, FilamentBuffers> convex_hulls_;
|
||||
std::unordered_map<int, FilamentBuffers> height_fields_;
|
||||
std::unordered_map<int, filament::Texture*> fonts_;
|
||||
std::unordered_map<int, filament::Texture*> textures_;
|
||||
std::unordered_map<int, SphericalHarmonics> spherical_harmonics_;
|
||||
std::unordered_map<int, filament::Texture*> fallback_textures_;
|
||||
|
||||
@@ -137,15 +137,6 @@ void mjr_readPixels(unsigned char* rgb, float* depth, mjrRect viewport,
|
||||
g_filament_context->ReadPixels(viewport, rgb, depth);
|
||||
}
|
||||
|
||||
void mjr_uploadFont(const unsigned char* pixels, int width, int height, int bpp,
|
||||
int id, const mjrContext* con) {
|
||||
CheckFilamentContext();
|
||||
if (bpp != 4) {
|
||||
mju_error("Only 4bpp fonts are supported, got %d", bpp);
|
||||
}
|
||||
g_filament_context->UploadFont(pixels, width, height, id);
|
||||
}
|
||||
|
||||
double mjr_getFrameRate(const mjrContext* con) {
|
||||
CheckFilamentContext();
|
||||
return g_filament_context->GetFrameRate();
|
||||
|
||||
@@ -74,9 +74,6 @@ MJAPI void mjr_uploadMesh(const mjModel* m, const mjrContext* con, int meshid);
|
||||
|
||||
MJAPI void mjr_uploadTexture(const mjModel* m, const mjrContext* con, int texid);
|
||||
|
||||
void mjr_uploadFont(const unsigned char* pixels, int width, int height, int bpp,
|
||||
int id, const mjrContext* con);
|
||||
|
||||
MJAPI void mjr_setBuffer(int framebuffer, mjrContext* con);
|
||||
|
||||
MJAPI void mjr_readPixels(unsigned char* rgb, float* depth, mjrRect viewport,
|
||||
|
||||
Reference in New Issue
Block a user