| 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)
virtual | ~FlutterWindowsView ()
void | SetEngine (std::unique_ptr< FlutterWindowsEngine > engine)
void | CreateRenderSurface ()
void | DestroyRenderSurface ()
WindowsRenderTarget * | GetRenderTarget () const
virtual PlatformWindow | GetPlatformWindow () const
FlutterWindowsEngine * | GetEngine ()
void | ForceRedraw ()
bool | ClearContext ()
bool | MakeCurrent ()
bool | MakeResourceCurrent ()
bool | SwapBuffers ()
bool | PresentSoftwareBitmap (const void *allocation, size_t row_bytes, size_t height)
void | SendInitialBounds ()
void | SendInitialAccessibilityFeatures ()
void | AnnounceAlert (const std::wstring &text)
void | UpdateHighContrastEnabled (bool enabled) 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
void | OnCursorRectUpdated (const Rect &rect) override
void | OnResetImeComposing () override
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 | ) |

Definition at line 41 of file flutter_windows_view.cc.

42 {
43 // Take the binding handler, and give it a pointer back to self.
44 binding_handler_ = std::move(window_binding);
45 binding_handler_->SetView(this);
46
47 render_target_ = std::make_unique<WindowsRenderTarget>(
48 binding_handler_->GetRenderTarget());
49 }

## ◆ ~FlutterWindowsView()

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

Definition at line 51 of file flutter_windows_view.cc.

51 {
52 // The engine renders into the view's surface. The engine must be
53 // shutdown before the view's resources can be destroyed.
54 if (engine_) {
55 engine_->Stop();
56 }
57
58 DestroyRenderSurface();
59 }

References DestroyRenderSurface().

## Member Function Documentation

## ◆ accessibility_bridge()

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

Definition at line 210 of file flutter_windows_view.h.

210 {
211 return accessibility_bridge_;
212 }

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

## ◆ AlertNode()

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

Definition at line 655 of file flutter_windows_view.cc.

655 {
656 return binding_handler_->GetAlert();
657 }

## ◆ AnnounceAlert()

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

Definition at line 634 of file flutter_windows_view.cc.

634 {
635 auto alert_delegate = binding_handler_->GetAlertDelegate();
636 if (!alert_delegate) {
637 return;
638 }
639 alert_delegate->SetText(fml::WideStringToUtf16(text));
640 ui::AXPlatformNodeWin* alert_node = binding_handler_->GetAlert();
641 NotifyWinEventWrapper(alert_node, ax::mojom::Event::kAlert);
642 }

References NotifyWinEventWrapper(), and text.

## ◆ ClearContext()

bool flutter::FlutterWindowsView::ClearContext | ( |  | ) |

Definition at line 544 of file flutter_windows_view.cc.

544 {
545 return engine_->surface_manager()->ClearContext();
546 }

## ◆ CreateAccessibilityBridge()

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

Definition at line 660 of file flutter_windows_view.cc.

660 {
661 return std::make_shared<AccessibilityBridgeWindows>(this);
662 }

Referenced by UpdateSemanticsEnabled().

## ◆ CreateRenderSurface()

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

Definition at line 590 of file flutter_windows_view.cc.

590 {
591 if (engine_ && engine_->surface_manager()) {
592 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
593 bool enable_vsync = binding_handler_->NeedsVSync();
594 engine_->surface_manager()->CreateSurface(GetRenderTarget(), bounds.width,
595 bounds.height, enable_vsync);
596
597 // The EGL context cannot be current on multiple threads.
598 // Creating the render surface runs on the platform thread and
599 // makes the EGL context current. Thus, the EGL context must be
600 // released so that the raster thread can use it for rendering.
601 engine_->surface_manager()->ClearCurrent();
602
603 resize_target_width_ = bounds.width;
604 resize_target_height_ = bounds.height;
605 }
606 }

References GetRenderTarget(), flutter::PhysicalWindowBounds::height, and flutter::PhysicalWindowBounds::width.

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

## ◆ DestroyRenderSurface()

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

Definition at line 608 of file flutter_windows_view.cc.

608 {
609 if (engine_ && engine_->surface_manager()) {
610 engine_->surface_manager()->DestroySurface();
611 }
612 }

Referenced by ~FlutterWindowsView().

## ◆ ForceRedraw()

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

Definition at line 100 of file flutter_windows_view.cc.

100 {
101 if (resize_status_ == ResizeState::kDone) {
102 // Request new frame.
103 engine_->ScheduleFrame();
104 }
105 }

Referenced by OnWindowRepaint().

## ◆ GetAxFragmentRootDelegate()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 651 of file flutter_windows_view.cc.

651 {
652 return accessibility_bridge_.get();
653 }

## ◆ GetEngine()

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

Definition at line 630 of file flutter_windows_view.cc.

630 {
631 return engine_.get();
632 }

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 73 of file flutter_windows_view.cc.

73 {
74 // Called on an engine-controlled (non-platform) thread.
75 std::unique_lock<std::mutex> lock(resize_mutex_);
76
77 if (resize_status_ != ResizeState::kResizeStarted) {
78 return kWindowFrameBufferID;
79 }
80
81 if (resize_target_width_ == width && resize_target_height_ == height) {
82 // Platform thread is blocked for the entire duration until the
83 // resize_status_ is set to kDone.
84 engine_->surface_manager()->ResizeSurface(GetRenderTarget(), width, height,
85 binding_handler_->NeedsVSync());
86 resize_status_ = ResizeState::kFrameGenerated;
87 }
88
89 return kWindowFrameBufferID;
90 }

References GetRenderTarget(), and flutter::kWindowFrameBufferID.

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

## ◆ GetNativeViewAccessible()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 255 of file flutter_windows_view.cc.

255 {
256 if (!accessibility_bridge_) {
257 return nullptr;
258 }
259
260 return accessibility_bridge_->GetChildOfAXFragmentRoot();
261 }

## ◆ GetPlatformWindow()

PlatformWindow flutter::FlutterWindowsView::GetPlatformWindow | ( |  | ) | const
| virtual

Definition at line 626 of file flutter_windows_view.cc.

626 {
627 return binding_handler_->GetPlatformWindow();
628 }

Referenced by FlutterDesktopViewGetHWND(), flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect(), and flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent().

## ◆ GetRenderTarget()

WindowsRenderTarget * flutter::FlutterWindowsView::GetRenderTarget | ( |  | ) | const

Definition at line 622 of file flutter_windows_view.cc.

622 {
623 return render_target_.get();
624 }

Referenced by CreateRenderSurface(), GetFrameBufferId(), flutter::PlatformHandler::GetHasStrings(), flutter::PlatformHandler::GetPlainText(), and flutter::PlatformHandler::SetPlainText().

## ◆ MakeCurrent()

bool flutter::FlutterWindowsView::MakeCurrent | ( |  | ) |

Definition at line 536 of file flutter_windows_view.cc.

536 {
537 return engine_->surface_manager()->MakeCurrent();
538 }

## ◆ MakeResourceCurrent()

bool flutter::FlutterWindowsView::MakeResourceCurrent | ( |  | ) |

Definition at line 540 of file flutter_windows_view.cc.

540 {
541 return engine_->surface_manager()->MakeResourceCurrent();
542 }

## ◆ NotifyWinEventWrapper()

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

Definition at line 644 of file flutter_windows_view.cc.

645 {
646 if (node) {
647 node->NotifyAccessibilityEvent(event);
648 }
649 }

Referenced by AnnounceAlert().

## ◆ OnComposeBegin()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 218 of file flutter_windows_view.cc.

218 {
219 SendComposeBegin();
220 }

## ◆ OnComposeChange()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 230 of file flutter_windows_view.cc.

231 {
232 SendComposeChange(text, cursor_pos);
233 }

References text.

## ◆ OnComposeCommit()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 222 of file flutter_windows_view.cc.

222 {
223 SendComposeCommit();
224 }

## ◆ OnComposeEnd()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 226 of file flutter_windows_view.cc.

226 {
227 SendComposeEnd();
228 }

## ◆ OnCursorRectUpdated()

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

Implements flutter::TextInputPluginDelegate.

Definition at line 263 of file flutter_windows_view.cc.

263 {
264 binding_handler_->OnCursorRectUpdated(rect);
265 }

## ◆ OnDwmCompositionChanged()

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

Definition at line 676 of file flutter_windows_view.cc.

676 {
677 AngleSurfaceManager* surface_manager = engine_->surface_manager();
678 if (!surface_manager) {
679 return;
680 }
681
682 // Update the surface with the new composition state.
683 // Switch to the raster thread as the render EGL context can only be
684 // current on a single thread a time.
685 auto needs_vsync = binding_handler_->NeedsVSync();
686 engine_->PostRasterThreadTask([surface_manager, needs_vsync]() {
687 if (!surface_manager->MakeCurrent()) {
688 FML_LOG(ERROR)
689 << "Unable to make surface current to update the swap interval";
690 return;
691 }
692
693 surface_manager->SetVSyncEnabled(needs_vsync);
694 });
695 }

References flutter::AngleSurfaceManager::MakeCurrent(), and flutter::AngleSurfaceManager::SetVSyncEnabled().

## ◆ 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 208 of file flutter_windows_view.cc.

214 {
215 SendKey(key, scancode, action, character, extended, was_down, callback);
216 }

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 154 of file flutter_windows_view.cc.

159 {
160 if (flutter_button != 0) {
161 auto state = GetOrCreatePointerState(device_kind, device_id);
162 state->buttons |= flutter_button;
163 SendPointerDown(x, y, state);
164 }
165 }

## ◆ 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 180 of file flutter_windows_view.cc.

183 {
184 SendPointerLeave(x, y, GetOrCreatePointerState(device_kind, device_id));
185 }

## ◆ 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 145 of file flutter_windows_view.cc.

149 {
150 engine_->keyboard_key_handler()->SyncModifiersIfNeeded(modifiers_state);
151 SendPointerMove(x, y, GetOrCreatePointerState(device_kind, device_id));
152 }

## ◆ OnPointerPanZoomEnd()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 200 of file flutter_windows_view.cc.

200 {
201 SendPointerPanZoomEnd(device_id);
202 }

## ◆ OnPointerPanZoomStart()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 187 of file flutter_windows_view.cc.

187 {
188 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
189 SendPointerPanZoomStart(device_id, point.x, point.y);
190 }

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 192 of file flutter_windows_view.cc.

196 {
197 SendPointerPanZoomUpdate(device_id, pan_x, pan_y, scale, rotation);
198 }

## ◆ 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 167 of file flutter_windows_view.cc.

172 {
173 if (flutter_button != 0) {
174 auto state = GetOrCreatePointerState(device_kind, device_id);
175 state->buttons &= ~flutter_button;
176 SendPointerUp(x, y, state);
177 }
178 }

## ◆ OnResetImeComposing()

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

Implements flutter::TextInputPluginDelegate.

Definition at line 267 of file flutter_windows_view.cc.

267 {
268 binding_handler_->OnResetImeComposing();
269 }

## ◆ 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 235 of file flutter_windows_view.cc.

241 {
242 SendScroll(x, y, delta_x, delta_y, scroll_offset_multiplier, device_kind,
243 device_id);
244 }

## ◆ OnScrollInertiaCancel()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 246 of file flutter_windows_view.cc.

246 {
247 PointerLocation point = binding_handler_->GetPrimaryPointerLocation();
248 SendScrollInertiaCancel(device_id, point.x, point.y);
249 }

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 204 of file flutter_windows_view.cc.

204 {
205 SendText(text);
206 }

References text.

## ◆ OnUpdateSemanticsEnabled()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 251 of file flutter_windows_view.cc.

251 {
252 engine_->UpdateSemanticsEnabled(enabled);
253 }

## ◆ OnWindowRepaint()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 141 of file flutter_windows_view.cc.

141 {
142 ForceRedraw();
143 }

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 107 of file flutter_windows_view.cc.

107 {
108 // Called on the platform thread.
109 std::unique_lock<std::mutex> lock(resize_mutex_);
110
111 if (!engine_->surface_manager()) {
112 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
113 return;
114 }
115
116 EGLint surface_width, surface_height;
117 engine_->surface_manager()->GetSurfaceDimensions(&surface_width,
118 &surface_height);
119
120 bool surface_will_update =
121 SurfaceWillUpdate(surface_width, surface_height, width, height);
122 if (surface_will_update) {
123 resize_status_ = ResizeState::kResizeStarted;
124 resize_target_width_ = width;
125 resize_target_height_ = height;
126 }
127
128 SendWindowMetrics(width, height, binding_handler_->GetDpiScale());
129
130 if (surface_will_update) {
131 // Block the platform thread until:
132 // 1. GetFrameBufferId is called with the right frame size.
133 // 2. Any pending SwapBuffers calls have been invoked.
134 resize_cv_.wait_for(lock, kWindowResizeTimeout,
135 [&resize_status = resize_status_] {
136 return resize_status == ResizeState::kDone;
137 });
138 }
139 }

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

## ◆ OnWindowStateEvent()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 697 of file flutter_windows_view.cc.

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

## ◆ PresentSoftwareBitmap()

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

Definition at line 583 of file flutter_windows_view.cc.

585 {
586 return binding_handler_->OnBitmapSurfaceUpdated(allocation, row_bytes,
587 height);
588 }

## ◆ SendInitialAccessibilityFeatures()

void flutter::FlutterWindowsView::SendInitialAccessibilityFeatures | ( |  | ) |

Definition at line 614 of file flutter_windows_view.cc.

614 {
615 binding_handler_->SendInitialAccessibilityFeatures();
616 }

## ◆ SendInitialBounds()

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

Definition at line 283 of file flutter_windows_view.cc.

283 {
284 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
285
286 SendWindowMetrics(bounds.width, bounds.height,
287 binding_handler_->GetDpiScale());
288 }

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

## ◆ SetEngine()

void flutter::FlutterWindowsView::SetEngine | ( | std::unique_ptr< FlutterWindowsEngine > | engine | ) |

Definition at line 61 of file flutter_windows_view.cc.

62 {
63 engine_ = std::move(engine);
64
65 engine_->SetView(this);
66
67 PhysicalWindowBounds bounds = binding_handler_->GetPhysicalWindowBounds();
68
69 SendWindowMetrics(bounds.width, bounds.height,
70 binding_handler_->GetDpiScale());
71 }

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

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

## ◆ SetFlutterCursor()

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

Definition at line 96 of file flutter_windows_view.cc.

96 {
97 binding_handler_->SetFlutterCursor(cursor);
98 }

## ◆ SwapBuffers()

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

Definition at line 548 of file flutter_windows_view.cc.

548 {
549 // Called on an engine-controlled (non-platform) thread.
550 std::unique_lock<std::mutex> lock(resize_mutex_);
551
552 switch (resize_status_) {
553 // SwapBuffer requests during resize are ignored until the frame with the
554 // right dimensions has been generated. This is marked with
555 // kFrameGenerated resize status.
556 case ResizeState::kResizeStarted:
557 return false;
558 case ResizeState::kFrameGenerated: {
559 bool visible = binding_handler_->IsVisible();
560 bool swap_buffers_result;
561 // For visible windows swap the buffers while resize handler is waiting.
562 // For invisible windows unblock the handler first and then swap buffers.
563 // SwapBuffers waits for vsync and there's no point doing that for
564 // invisible windows.
565 if (visible) {
566 swap_buffers_result = engine_->surface_manager()->SwapBuffers();
567 }
568 resize_status_ = ResizeState::kDone;
569 lock.unlock();
570 resize_cv_.notify_all();
571 binding_handler_->OnWindowResized();
572 if (!visible) {
573 swap_buffers_result = engine_->surface_manager()->SwapBuffers();
574 }
575 return swap_buffers_result;
576 }
577 case ResizeState::kDone:
578 default:
579 return engine_->surface_manager()->SwapBuffers();
580 }
581 }

## ◆ UpdateFlutterCursor()

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

Definition at line 92 of file flutter_windows_view.cc.

92 {
93 binding_handler_->UpdateFlutterCursor(cursor_name);
94 }

## ◆ UpdateHighContrastEnabled()

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

Implements flutter::WindowBindingHandlerDelegate.

Definition at line 618 of file flutter_windows_view.cc.

618 {
619 engine_->UpdateHighContrastEnabled(enabled);
620 }

## ◆ UpdateSemanticsEnabled()

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

Definition at line 664 of file flutter_windows_view.cc.

664 {
665 if (semantics_enabled_ != enabled) {
666 semantics_enabled_ = enabled;
667
668 if (!semantics_enabled_ && accessibility_bridge_) {
669 accessibility_bridge_.reset();
670 } else if (semantics_enabled_ && !accessibility_bridge_) {
671 accessibility_bridge_ = CreateAccessibilityBridge();
672 }
673 }
674 }

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
flutter::FlutterWindowsView::GetRenderTarget
WindowsRenderTarget * GetRenderTarget() const
Definition: flutter_windows_view.cc:622
was_down
bool was_down
Definition: keyboard_key_handler_unittests.cc:119
extended
bool extended
Definition: keyboard_key_handler_unittests.cc:118
character
char32_t character
Definition: keyboard_key_handler_unittests.cc:117
flutter::FlutterWindowsView::ForceRedraw
void ForceRedraw()
Definition: flutter_windows_view.cc:100
flutter::FlutterWindowsView::DestroyRenderSurface
void DestroyRenderSurface()
Definition: flutter_windows_view.cc:608
flutter::kWindowFrameBufferID
constexpr uint32_t kWindowFrameBufferID
Definition: flutter_windows_view.h:31
text
std::u16string text
Definition: keyboard_unittests.cc:332
flutter::FlutterWindowsView::NotifyWinEventWrapper
virtual void NotifyWinEventWrapper(ui::AXPlatformNodeWin *node, ax::mojom::Event event)
Definition: flutter_windows_view.cc:644
flutter::FlutterWindowsView::CreateAccessibilityBridge
virtual std::shared_ptr< AccessibilityBridgeWindows > CreateAccessibilityBridge()
Definition: flutter_windows_view.cc:660
action
int action
Definition: keyboard_key_handler_unittests.cc:116
key
int key
Definition: keyboard_key_handler_unittests.cc:114
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:46