iris: move text state into shared resources
This commit is contained in:
1 parent
7c23c5f146
commit
51719ed121
17 files changed
+631
-434
No files matched your search
+8
-8
@@ -217,7 +217,7 @@ impl<State: AndroidAppState> IrisViewPeer<State> {
|
||||
if old_focus != ui_state.focus
|
||||
&& let Some(old) = old_focus
|
||||
{
|
||||
old.edit(&mut self.rsc).deselect();
|
||||
old(&mut self.rsc).deselect();
|
||||
}
|
||||
if std::mem::take(&mut ui_state.pending_show_keyboard) {
|
||||
show_soft_input(&mut ctx.env, &ctx.view);
|
||||
@@ -619,7 +619,7 @@ impl<State: AndroidAppState> ViewPeer for IrisViewPeer<State> {
|
||||
if !gain_focus {
|
||||
let ui_state = self.state.android_state_mut();
|
||||
if let Some(focus) = ui_state.focus.take() {
|
||||
focus.edit(&mut self.rsc).deselect();
|
||||
focus(&mut self.rsc).deselect();
|
||||
}
|
||||
}
|
||||
self.after_input(ctx);
|
||||
@@ -646,8 +646,8 @@ impl<State: AndroidAppState> ViewPeer for IrisViewPeer<State> {
|
||||
log::info!(
|
||||
"iris surface: surface_changed {width}x{height} already_live={already_live} \
|
||||
glyphs_cached={} atlas_pages={}",
|
||||
self.rsc.ui().text.atlas.glyph_count(),
|
||||
self.rsc.ui().text.atlas.page_count(),
|
||||
self.rsc.ui().text.borrow().atlas.glyph_count(),
|
||||
self.rsc.ui().text.borrow().atlas.page_count(),
|
||||
);
|
||||
if already_live {
|
||||
let ui_state = self.state.android_state_mut();
|
||||
@@ -691,8 +691,8 @@ impl<State: AndroidAppState> ViewPeer for IrisViewPeer<State> {
|
||||
"iris surface: new renderer built ({:?}), re-uploading textures: \
|
||||
glyphs={} pages={}",
|
||||
renderer.adapter_backend,
|
||||
self.rsc.ui().text.atlas.glyph_count(),
|
||||
self.rsc.ui().text.atlas.page_count(),
|
||||
self.rsc.ui().text.borrow().atlas.glyph_count(),
|
||||
self.rsc.ui().text.borrow().atlas.page_count(),
|
||||
);
|
||||
self.rsc.ui_mut().textures.reupload();
|
||||
self.rsc.ui_mut().paints.reupload();
|
||||
@@ -716,8 +716,8 @@ impl<State: AndroidAppState> ViewPeer for IrisViewPeer<State> {
|
||||
log::info!(
|
||||
"iris surface: surface_destroyed, tearing the renderer down \
|
||||
(glyphs_cached={} atlas_pages={})",
|
||||
self.rsc.ui().text.atlas.glyph_count(),
|
||||
self.rsc.ui().text.atlas.page_count(),
|
||||
self.rsc.ui().text.borrow().atlas.glyph_count(),
|
||||
self.rsc.ui().text.borrow().atlas.page_count(),
|
||||
);
|
||||
self.state.android_state_mut().renderer = None;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user