| Flutter Windows Embedder |

Classes | Public Member Functions | Protected Member Functions | List of all members
flutter::FlutterWindowsView Class Reference

`#include <flutter_windows_view.h>`

Inheritance diagram for flutter::FlutterWindowsView:

## Public Member Functions
| FlutterWindowsView (std::unique_ptr< WindowBindingHandler > window_binding, std::shared_ptr< WindowsProcTable > windows_proc_table=nullptr)
virtual | ~FlutterWindowsView ()
void | SetEngine (FlutterWindowsEngine *engine)
void | CreateRenderSurface ()
void | DestroyRenderSurface ()
virtual HWND | GetWindowHandle () const
FlutterWindowsEngine * | GetEngine ()
void | ForceRedraw ()
bool | SwapBuffers ()
bool | PresentSoftwareBitmap (const void *allocation, size_t row_bytes, size_t height)
void | SendInitialBounds ()
void | AnnounceAlert (const std::wstring &text)
void | OnHighContrastChanged () override
uint32_t | GetFrameBufferId (size_t width, size_t height)
void | UpdateFlutterCursor (const std::string &cursor_name)
void | SetFlutterCursor (HCURSOR cursor)
void | OnWindowSizeChanged (size_t width, size_t height) override
void | OnWindowRepaint () override
void | OnPointerMove (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, int modifiers_state) override
void | OnPointerDown (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
void | OnPointerUp (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id, FlutterPointerMouseButtons button) override
void | OnPointerLeave (double x, double y, FlutterPointerDeviceKind device_kind, int32_t device_id=0) override
virtual void | OnPointerPanZoomStart (int32_t device_id) override
virtual void | OnPointerPanZoomUpdate (int32_t device_id, double pan_x, double pan_y, double scale, double rotation) override
virtual void | OnPointerPanZoomEnd (int32_t device_id) override
void | OnText (const std::u16string &) override
void | OnKey (int key, int scancode, int action, char32_t character, bool extended, bool was_down, KeyEventCallback callback) override
void | OnComposeBegin () override
void | OnComposeCommit () override
void | OnComposeEnd () override
void | OnComposeChange (const std::u16string &text, int cursor_pos) override
void | OnScroll (double x, double y, double delta_x, double delta_y, int scroll_offset_multiplier, FlutterPointerDeviceKind device_kind, int32_t device_id) override
void | OnScrollInertiaCancel (int32_t device_id) override
virtual void | OnUpdateSemanticsEnabled (bool enabled) override
virtual gfx::NativeViewAccessible | GetNativeViewAccessible () override
virtual void | OnCursorRectUpdated (const Rect &rect)
virtual void | OnResetImeComposing ()
void | OnDwmCompositionChanged ()
ui::AXPlatformNodeWin * | AlertNode () const
virtual ui::AXFragmentRootDelegateWin * | GetAxFragmentRootDelegate () override
virtual void | UpdateSemanticsEnabled (bool enabled)
std::weak_ptr< AccessibilityBridgeWindows > | accessibility_bridge ()
void | OnWindowStateEvent (HWND hwnd, WindowStateEvent event) override

## Protected Member Functions
virtual void | NotifyWinEventWrapper (ui::AXPlatformNodeWin *node, ax::mojom::Event event)
virtual std::shared_ptr< AccessibilityBridgeWindows > | CreateAccessibilityBridge ()

## Additional Inherited Members
Public Types inherited from flutter::WindowBindingHandlerDelegate
using | KeyEventCallback = std::function< void(bool)>

## Detailed Description

Definition at line 35 of file flutter_windows_view.h.

## Constructor & Destructor Documentation

## ◆ FlutterWindowsView()

flutter::FlutterWindowsView::FlutterWindowsView | ( | std::unique_ptr< WindowBindingHandler > | window_binding,
|  | std::shared_ptr< WindowsProcTable > | windows_proc_table = `nullptr`
| ) |  |

Definition at line 72 of file flutter_windows_view.cc.

75 : windows_proc_table_(std::move(windows_proc_table)) {
76 if (windows_proc_table_ == nullptr) {
77 windows_proc_table_ = std::make_shared<WindowsProcTable>();
78 }
79
80 // Take the binding handler, and give it a pointer back to self.
81 binding_handler_ = std::move(window_binding);
82 binding_handler_->SetView(this);
83 }

## ◆ ~FlutterWindowsView()

flutter::FlutterWindowsView::~FlutterWindowsView | ( |  | ) |
| virtual

Definition at line 85 of file flutter_windows_view.cc.

85 {
86 // The engine renders into the view's surface. The engine must be
87 // shutdown before the view's resources can be destroyed.
88 if (engine_) {
89 engine_->Stop();
90 }
91
92 DestroyRenderSurface();
93 }

References DestroyRenderSurface(), and flutter::FlutterWindowsEngine::Stop().

## Member Function Documentation

## ◆ accessibility_bridge()

std::weak_ptr<AccessibilityBridgeWindows> flutter::FlutterWindowsView::accessibility_bridge | ( |  | ) |
| inline

Definition at line 207 of file flutter_windows_view.h.

207 {
208 return accessibility_bridge_;
209 }

Referenced by flutter::FlutterWindowsEngine::Run().

## ◆ AlertNode()

ui::AXPlatformNodeWin * flutter::FlutterWindowsView::AlertNode | ( |  | ) | const

Definition at line 674 of file flutter_windows_view.cc.

674 {
675 return binding_handler_->GetAlert();
676 }

## ◆ AnnounceAlert()

void flutter::FlutterWindowsView::AnnounceAlert | ( | const std::wstring & | text | ) |

Definition at line 653 of file flutter_windows_view.cc.

653 {
654 auto alert_delegate = binding_handler_->GetAlertDelegate();
655 if (!alert_delegate) {
656 return;
657 }
658 alert_delegate->SetText(fml::WideStringToUtf16(text));
659 ui::AXPlatformNodeWin* alert_node = binding_handler_->GetAlert();
660 NotifyWinEventWrapper(alert_node, ax::mojom::Event::kAlert);
661 }

References NotifyWinEventWrapper(), and text.

## ◆ CreateAccessibilityBridge()

std::shared_ptr< AccessibilityBridgeWindows > flutter::FlutterWindowsView::CreateAccessibilityBridge | ( |  | ) |
| protected virtual

Definition at line 679 of file flutter_windows_view.cc.

679 {
680 return std::make_shared<AccessibilityBridgeWindows>(this);
681 }

Referenced by UpdateSemanticsEnabled().

## ◆ CreateRenderSurface()

void flutter::FlutterWindowsView::CreateRenderSurface | ( |  | ) |

Definition at line 622 of file flutter_windows_view.cc.

622 {
623 if (engine_ && engine_->surface_manager()) {
624 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
625 engine_->surface_manager()->CreateSurface(GetWindowHandle(), bounds.width,
626 bounds.height);
627
628 UpdateVsync(*engine_, NeedsVsync());
629
630 resize_target_width_ = bounds.width;
631 resize_target_height_ = bounds.height;
632 }
633 }

References flutter::AngleSurfaceManager::CreateSurface(), GetWindowHandle(), flutter::PhysicalWindowBounds::height, flutter::FlutterWindowsEngine::surface_manager(), and flutter::PhysicalWindowBounds::width.

Referenced by flutter::testing::TEST().

## ◆ DestroyRenderSurface()

void flutter::FlutterWindowsView::DestroyRenderSurface | ( |  | ) |

Definition at line 635 of file flutter_windows_view.cc.

635 {
636 if (engine_ && engine_->surface_manager()) {
637 engine_->surface_manager()->DestroySurface();
638 }
639 }

References flutter::AngleSurfaceManager::DestroySurface(), and flutter::FlutterWindowsEngine::surface_manager().

Referenced by ~FlutterWindowsView().

## ◆ ForceRedraw()

void flutter::FlutterWindowsView::ForceRedraw | ( |  | ) |

Definition at line 136 of file flutter_windows_view.cc.

136 {
137 if (resize_status_ == ResizeState::kDone) {
138 // Request new frame.
139 engine_->ScheduleFrame();
140 }
141 }

References flutter::FlutterWindowsEngine::ScheduleFrame().

Referenced by OnWindowRepaint().

## ◆ GetAxFragmentRootDelegate()

ui::AXFragmentRootDelegateWin * flutter::FlutterWindowsView::GetAxFragmentRootDelegate | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 670 of file flutter_windows_view.cc.

670 {
671 return accessibility_bridge_.get();
672 }

## ◆ GetEngine()

FlutterWindowsEngine * flutter::FlutterWindowsView::GetEngine | ( |  | ) |

Definition at line 649 of file flutter_windows_view.cc.

649 {
650 return engine_;
651 }

Referenced by flutter::AccessibilityBridgeWindows::DispatchAccessibilityAction(), FlutterDesktopViewGetGraphicsAdapter(), and flutter::testing::TEST().

## ◆ GetFrameBufferId()

uint32_t flutter::FlutterWindowsView::GetFrameBufferId | ( | size_t | width,
|  | size_t | height
| ) |  |

Definition at line 109 of file flutter_windows_view.cc.

109 {
110 // Called on an engine-controlled (non-platform) thread.
111 std::unique_lock<std::mutex> lock(resize_mutex_);
112
113 if (resize_status_ != ResizeState::kResizeStarted) {
114 return kWindowFrameBufferID;
115 }
116
117 if (resize_target_width_ == width && resize_target_height_ == height) {
118 // Platform thread is blocked for the entire duration until the
119 // resize_status_ is set to kDone.
120 engine_->surface_manager()->ResizeSurface(GetWindowHandle(), width, height,
121 NeedsVsync());
122 resize_status_ = ResizeState::kFrameGenerated;
123 }
124
125 return kWindowFrameBufferID;
126 }

References GetWindowHandle(), flutter::kWindowFrameBufferID, flutter::AngleSurfaceManager::ResizeSurface(), and flutter::FlutterWindowsEngine::surface_manager().

Referenced by flutter::testing::TEST().

## ◆ GetNativeViewAccessible()

gfx::NativeViewAccessible flutter::FlutterWindowsView::GetNativeViewAccessible | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 291 of file flutter_windows_view.cc.

291 {
292 if (!accessibility_bridge_) {
293 return nullptr;
294 }
295
296 return accessibility_bridge_->GetChildOfAXFragmentRoot();
297 }

## ◆ GetWindowHandle()

HWND flutter::FlutterWindowsView::GetWindowHandle | ( |  | ) | const
| virtual

Definition at line 645 of file flutter_windows_view.cc.

645 {
646 return binding_handler_->GetWindowHandle();
647 }

Referenced by CreateRenderSurface(), FlutterDesktopViewGetHWND(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), GetFrameBufferId(), flutter::PlatformHandler::GetHasStrings(), flutter::PlatformHandler::GetPlainText(), flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent(), and flutter::PlatformHandler::SetPlainText().

## ◆ NotifyWinEventWrapper()

void flutter::FlutterWindowsView::NotifyWinEventWrapper | ( | ui::AXPlatformNodeWin * | node,
|  | ax::mojom::Event | event
| ) |  |
| protected virtual

Definition at line 663 of file flutter_windows_view.cc.

664 {
665 if (node) {
666 node->NotifyAccessibilityEvent(event);
667 }
668 }

Referenced by AnnounceAlert().

## ◆ OnComposeBegin()

void flutter::FlutterWindowsView::OnComposeBegin | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 254 of file flutter_windows_view.cc.

254 {
255 SendComposeBegin();
256 }

## ◆ OnComposeChange()

void flutter::FlutterWindowsView::OnComposeChange | ( | const std::u16string & | text,
|  | int | cursor_pos
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 266 of file flutter_windows_view.cc.

267 {
268 SendComposeChange(text, cursor_pos);
269 }

References text.

## ◆ OnComposeCommit()

void flutter::FlutterWindowsView::OnComposeCommit | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 258 of file flutter_windows_view.cc.

258 {
259 SendComposeCommit();
260 }

## ◆ OnComposeEnd()

void flutter::FlutterWindowsView::OnComposeEnd | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 262 of file flutter_windows_view.cc.

262 {
263 SendComposeEnd();
264 }

## ◆ OnCursorRectUpdated()

void flutter::FlutterWindowsView::OnCursorRectUpdated | ( | const Rect & | rect | ) |
| virtual

Definition at line 299 of file flutter_windows_view.cc.

299 {
300 binding_handler_->OnCursorRectUpdated(rect);
301 }

## ◆ OnDwmCompositionChanged()

void flutter::FlutterWindowsView::OnDwmCompositionChanged | ( |  | ) |

Definition at line 695 of file flutter_windows_view.cc.

695 {
696 UpdateVsync(*engine_, NeedsVsync());
697 }

## ◆ OnHighContrastChanged()

void flutter::FlutterWindowsView::OnHighContrastChanged | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 641 of file flutter_windows_view.cc.

641 {
642 engine_->UpdateHighContrastMode();
643 }

References flutter::FlutterWindowsEngine::UpdateHighContrastMode().

## ◆ OnKey()

void flutter::FlutterWindowsView::OnKey | ( | int | key,
|  | int | scancode,
|  | int | action,
|  | char32_t | character,
|  | bool | extended,
|  | bool | was_down,
|  | KeyEventCallback | callback
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 244 of file flutter_windows_view.cc.

250 {
251 SendKey(key, scancode, action, character, extended, was_down, callback);
252 }

References action, callback, character, extended, key, scancode, and was_down.

## ◆ OnPointerDown()

void flutter::FlutterWindowsView::OnPointerDown | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | FlutterPointerMouseButtons | button
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 190 of file flutter_windows_view.cc.

195 {
196 if (flutter_button != 0) {
197 auto state = GetOrCreatePointerState(device_kind, device_id);
198 state->buttons |= flutter_button;
199 SendPointerDown(x, y, state);
200 }
201 }

## ◆ OnPointerLeave()

void flutter::FlutterWindowsView::OnPointerLeave | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id = `0`
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 216 of file flutter_windows_view.cc.

219 {
220 SendPointerLeave(x, y, GetOrCreatePointerState(device_kind, device_id));
221 }

## ◆ OnPointerMove()

void flutter::FlutterWindowsView::OnPointerMove | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | int | modifiers_state
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 181 of file flutter_windows_view.cc.

185 {
186 engine_->keyboard_key_handler()->SyncModifiersIfNeeded(modifiers_state);
187 SendPointerMove(x, y, GetOrCreatePointerState(device_kind, device_id));
188 }

References flutter::FlutterWindowsEngine::keyboard_key_handler(), and flutter::KeyboardHandlerBase::SyncModifiersIfNeeded().

## ◆ OnPointerPanZoomEnd()

void flutter::FlutterWindowsView::OnPointerPanZoomEnd | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 236 of file flutter_windows_view.cc.

236 {
237 SendPointerPanZoomEnd(device_id);
238 }

## ◆ OnPointerPanZoomStart()

void flutter::FlutterWindowsView::OnPointerPanZoomStart | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 223 of file flutter_windows_view.cc.

223 {
224 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
225 SendPointerPanZoomStart(device_id, point.x, point.y);
226 }

References flutter::PointerLocation::x, and flutter::PointerLocation::y.

## ◆ OnPointerPanZoomUpdate()

void flutter::FlutterWindowsView::OnPointerPanZoomUpdate | ( | int32_t | device_id,
|  | double | pan_x,
|  | double | pan_y,
|  | double | scale,
|  | double | rotation
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 228 of file flutter_windows_view.cc.

232 {
233 SendPointerPanZoomUpdate(device_id, pan_x, pan_y, scale, rotation);
234 }

## ◆ OnPointerUp()

void flutter::FlutterWindowsView::OnPointerUp | ( | double | x,
|  | double | y,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id,
|  | FlutterPointerMouseButtons | button
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 203 of file flutter_windows_view.cc.

208 {
209 if (flutter_button != 0) {
210 auto state = GetOrCreatePointerState(device_kind, device_id);
211 state->buttons &= ~flutter_button;
212 SendPointerUp(x, y, state);
213 }
214 }

## ◆ OnResetImeComposing()

void flutter::FlutterWindowsView::OnResetImeComposing | ( |  | ) |
| virtual

Definition at line 303 of file flutter_windows_view.cc.

303 {
304 binding_handler_->OnResetImeComposing();
305 }

## ◆ OnScroll()

void flutter::FlutterWindowsView::OnScroll | ( | double | x,
|  | double | y,
|  | double | delta_x,
|  | double | delta_y,
|  | int | scroll_offset_multiplier,
|  | FlutterPointerDeviceKind | device_kind,
|  | int32_t | device_id
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 271 of file flutter_windows_view.cc.

277 {
278 SendScroll(x, y, delta_x, delta_y, scroll_offset_multiplier, device_kind,
279 device_id);
280 }

## ◆ OnScrollInertiaCancel()

void flutter::FlutterWindowsView::OnScrollInertiaCancel | ( | int32_t | device_id | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 282 of file flutter_windows_view.cc.

282 {
283 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
284 SendScrollInertiaCancel(device_id, point.x, point.y);
285 }

References flutter::PointerLocation::x, and flutter::PointerLocation::y.

## ◆ OnText()

void flutter::FlutterWindowsView::OnText | ( | const std::u16string & | text | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 240 of file flutter_windows_view.cc.

240 {
241 SendText(text);
242 }

References text.

## ◆ OnUpdateSemanticsEnabled()

void flutter::FlutterWindowsView::OnUpdateSemanticsEnabled | ( | bool | enabled | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 287 of file flutter_windows_view.cc.

287 {
288 engine_->UpdateSemanticsEnabled(enabled);
289 }

References flutter::FlutterWindowsEngine::UpdateSemanticsEnabled().

## ◆ OnWindowRepaint()

void flutter::FlutterWindowsView::OnWindowRepaint | ( |  | ) |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 177 of file flutter_windows_view.cc.

177 {
178 ForceRedraw();
179 }

References ForceRedraw().

Referenced by flutter::testing::TEST().

## ◆ OnWindowSizeChanged()

void flutter::FlutterWindowsView::OnWindowSizeChanged | ( | size_t | width,
|  | size_t | height
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 143 of file flutter_windows_view.cc.

143 {
144 // Called on the platform thread.
145 std::unique_lock<std::mutex> lock(resize_mutex_);
146
147 if (!engine_->surface_manager()) {
148 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
149 return;
150 }
151
152 EGLint surface_width, surface_height;
153 engine_->surface_manager()->GetSurfaceDimensions(&surface_width,
154 &surface_height);
155
156 bool surface_will_update =
157 SurfaceWillUpdate(surface_width, surface_height, width, height);
158 if (surface_will_update) {
159 resize_status_ = ResizeState::kResizeStarted;
160 resize_target_width_ = width;
161 resize_target_height_ = height;
162 }
163
164 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
165
166 if (surface_will_update) {
167 // Block the platform thread until:
168 // 1. GetFrameBufferId is called with the right frame size.
169 // 2. Any pending SwapBuffers calls have been invoked.
170 resize_cv_.wait_for(lock, kWindowResizeTimeout,
171 [&resize_status = resize_status_] {
172 return resize_status == ResizeState::kDone;
173 });
174 }
175 }

References flutter::AngleSurfaceManager::GetSurfaceDimensions(), and flutter::FlutterWindowsEngine::surface_manager().

Referenced by flutter::testing::TEST().

## ◆ OnWindowStateEvent()

void flutter::FlutterWindowsView::OnWindowStateEvent | ( | HWND | hwnd,
|  | WindowStateEvent | event
| ) |  |
| override virtual

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 699 of file flutter_windows_view.cc.

699 {
700 if (engine_) {
701 engine_->OnWindowStateEvent(hwnd, event);
702 }
703 }

References flutter::FlutterWindowsEngine::OnWindowStateEvent().

## ◆ PresentSoftwareBitmap()

bool flutter::FlutterWindowsView::PresentSoftwareBitmap | ( | const void * | allocation,
|  | size_t | row_bytes,
|  | size_t | height
| ) |  |

Definition at line 615 of file flutter_windows_view.cc.

617 {
618 return binding_handler_->OnBitmapSurfaceUpdated(allocation, row_bytes,
619 height);
620 }

## ◆ SendInitialBounds()

void flutter::FlutterWindowsView::SendInitialBounds | ( |  | ) |

Definition at line 319 of file flutter_windows_view.cc.

319 {
320 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
321
322 SendWindowMetrics(bounds.width, bounds.height,
323 binding_handler_->GetDpiScale());
324 }

References flutter::PhysicalWindowBounds::height, and flutter::PhysicalWindowBounds::width.

## ◆ SetEngine()

void flutter::FlutterWindowsView::SetEngine | ( | FlutterWindowsEngine * | engine | ) |

Definition at line 95 of file flutter_windows_view.cc.

95 {
96 FML_DCHECK(engine_ == nullptr);
97 FML_DCHECK(engine != nullptr);
98
99 engine_ = engine;
100
101 engine_->SetView(this);
102
103 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
104
105 SendWindowMetrics(bounds.width, bounds.height,
106 binding_handler_->GetDpiScale());
107 }

References flutter::PhysicalWindowBounds::height, flutter::FlutterWindowsEngine::SetView(), and flutter::PhysicalWindowBounds::width.

Referenced by flutter::testing::TEST().

## ◆ SetFlutterCursor()

void flutter::FlutterWindowsView::SetFlutterCursor | ( | HCURSOR | cursor | ) |

Definition at line 132 of file flutter_windows_view.cc.

132 {
133 binding_handler_->SetFlutterCursor(cursor);
134 }

## ◆ SwapBuffers()

bool flutter::FlutterWindowsView::SwapBuffers | ( |  | ) |

Definition at line 576 of file flutter_windows_view.cc.

576 {
577 // Called on an engine-controlled (non-platform) thread.
578 std::unique_lock<std::mutex> lock(resize_mutex_);
579
580 switch (resize_status_) {
581 // SwapBuffer requests during resize are ignored until the frame with the
582 // right dimensions has been generated. This is marked with
583 // kFrameGenerated resize status.
584 case ResizeState::kResizeStarted:
585 return false;
586 case ResizeState::kFrameGenerated: {
587 bool visible = binding_handler_->IsVisible();
588 bool swap_buffers_result;
589 // For visible windows swap the buffers while resize handler is waiting.
590 // For invisible windows unblock the handler first and then swap buffers.
591 // SwapBuffers waits for vsync and there's no point doing that for
592 // invisible windows.
593 if (visible) {
594 swap_buffers_result = engine_->surface_manager()->SwapBuffers();
595 }
596 resize_status_ = ResizeState::kDone;
597 lock.unlock();
598 resize_cv_.notify_all();
599
600 // Blocking the raster thread until DWM flushes alleviates glitches where
601 // previous size surface is stretched over current size view.
602 windows_proc_table_->DwmFlush();
603
604 if (!visible) {
605 swap_buffers_result = engine_->surface_manager()->SwapBuffers();
606 }
607 return swap_buffers_result;
608 }
609 case ResizeState::kDone:
610 default:
611 return engine_->surface_manager()->SwapBuffers();
612 }
613 }

References flutter::FlutterWindowsEngine::surface_manager(), and flutter::AngleSurfaceManager::SwapBuffers().

## ◆ UpdateFlutterCursor()

void flutter::FlutterWindowsView::UpdateFlutterCursor | ( | const std::string & | cursor_name | ) |

Definition at line 128 of file flutter_windows_view.cc.

128 {
129 binding_handler_->UpdateFlutterCursor(cursor_name);
130 }

## ◆ UpdateSemanticsEnabled()

void flutter::FlutterWindowsView::UpdateSemanticsEnabled | ( | bool | enabled | ) |
| virtual

Definition at line 683 of file flutter_windows_view.cc.

683 {
684 if (semantics_enabled_ != enabled) {
685 semantics_enabled_ = enabled;
686
687 if (!semantics_enabled_ && accessibility_bridge_) {
688 accessibility_bridge_.reset();
689 } else if (semantics_enabled_ && !accessibility_bridge_) {
690 accessibility_bridge_ = CreateAccessibilityBridge();
691 }
692 }
693 }

References CreateAccessibilityBridge().

The documentation for this class was generated from the following files:

- shell/platform/windows/flutter_windows_view.h
- shell/platform/windows/flutter_windows_view.cc

scancode
int scancode
Definition: keyboard_key_handler_unittests.cc:115
was_down
bool was_down
Definition: keyboard_key_handler_unittests.cc:119
extended
bool extended
Definition: keyboard_key_handler_unittests.cc:118
flutter::AngleSurfaceManager::CreateSurface
virtual bool CreateSurface(HWND hwnd, EGLint width, EGLint height)
Definition: angle_surface_manager.cc:232
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
flutter::FlutterWindowsView::ForceRedraw
void ForceRedraw()
Definition: flutter_windows_view.cc:136
flutter::FlutterWindowsView::DestroyRenderSurface
void DestroyRenderSurface()
Definition: flutter_windows_view.cc:635
flutter::kWindowFrameBufferID
constexpr uint32_t kWindowFrameBufferID
Definition: flutter_windows_view.h:31
flutter::FlutterWindowsView::GetWindowHandle
virtual HWND GetWindowHandle() const
Definition: flutter_windows_view.cc:645
flutter::FlutterWindowsEngine::Stop
virtual bool Stop()
Definition: flutter_windows_engine.cc:450
text
std::u16string text
Definition: keyboard_unittests.cc:332
flutter::KeyboardHandlerBase::SyncModifiersIfNeeded
virtual void SyncModifiersIfNeeded(int modifiers_state)=0
flutter::AngleSurfaceManager::DestroySurface
virtual void DestroySurface()
Definition: angle_surface_manager.cc:301
flutter::FlutterWindowsEngine::keyboard_key_handler
KeyboardHandlerBase * keyboard_key_handler()
Definition: flutter_windows_engine.h:163
flutter::FlutterWindowsEngine::surface_manager
AngleSurfaceManager * surface_manager() const
Definition: flutter_windows_engine.h:144
flutter::FlutterWindowsView::NotifyWinEventWrapper
virtual void NotifyWinEventWrapper(ui::AXPlatformNodeWin *node, ax::mojom::Event event)
Definition: flutter_windows_view.cc:663
flutter::FlutterWindowsEngine::ScheduleFrame
void ScheduleFrame()
Definition: flutter_windows_engine.cc:587
flutter::FlutterWindowsEngine::UpdateHighContrastMode
void UpdateHighContrastMode()
Definition: flutter_windows_engine.cc:751
flutter::AngleSurfaceManager::SwapBuffers
EGLBoolean SwapBuffers()
Definition: angle_surface_manager.cc:332
flutter::FlutterWindowsView::CreateAccessibilityBridge
virtual std::shared_ptr< AccessibilityBridgeWindows > CreateAccessibilityBridge()
Definition: flutter_windows_view.cc:679
action
int action
Definition: keyboard_key_handler_unittests.cc:116
flutter::FlutterWindowsEngine::UpdateSemanticsEnabled
void UpdateSemanticsEnabled(bool enabled)
Definition: flutter_windows_engine.cc:718
flutter::AngleSurfaceManager::GetSurfaceDimensions
void GetSurfaceDimensions(EGLint *width, EGLint *height)
Definition: angle_surface_manager.cc:286
key
int key
Definition: keyboard_key_handler_unittests.cc:114
flutter::FlutterWindowsEngine::OnWindowStateEvent
void OnWindowStateEvent(HWND hwnd, WindowStateEvent event)
Definition: flutter_windows_engine.cc:809
flutter::AngleSurfaceManager::ResizeSurface
virtual void ResizeSurface(HWND hwnd, EGLint width, EGLint height, bool enable_vsync)
Definition: angle_surface_manager.cc:262
flutter::FlutterWindowsEngine::SetView
void SetView(FlutterWindowsView *view)
Definition: flutter_windows_engine.cc:463
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:48