Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions shell/platform/windows/flutter_windows_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ FlutterRendererConfig GetOpenGLRendererConfig() {
config.open_gl.struct_size = sizeof(config.open_gl);
config.open_gl.make_current = [](void* user_data) -> bool {
auto host = static_cast<FlutterWindowsEngine*>(user_data);
if (!host->view()) {
if (!host->surface_manager()) {
return false;
}
return host->view()->MakeCurrent();
return host->surface_manager()->MakeCurrent();
};
config.open_gl.clear_current = [](void* user_data) -> bool {
auto host = static_cast<FlutterWindowsEngine*>(user_data);
if (!host->view()) {
if (!host->surface_manager()) {
return false;
}
return host->view()->ClearContext();
return host->surface_manager()->ClearContext();
};
config.open_gl.present = [](void* user_data) -> bool {
auto host = static_cast<FlutterWindowsEngine*>(user_data);
Expand All @@ -89,10 +89,10 @@ FlutterRendererConfig GetOpenGLRendererConfig() {
};
config.open_gl.make_resource_current = [](void* user_data) -> bool {
auto host = static_cast<FlutterWindowsEngine*>(user_data);
if (!host->view()) {
if (!host->surface_manager()) {
return false;
}
return host->view()->MakeResourceCurrent();
return host->surface_manager()->MakeResourceCurrent();
};
config.open_gl.gl_external_texture_frame_callback =
[](void* user_data, int64_t texture_id, size_t width, size_t height,
Expand Down
12 changes: 0 additions & 12 deletions shell/platform/windows/flutter_windows_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,6 @@ void FlutterWindowsView::SendPointerEventWithData(
}
}

bool FlutterWindowsView::MakeCurrent() {
return engine_->surface_manager()->MakeCurrent();
}

bool FlutterWindowsView::MakeResourceCurrent() {
return engine_->surface_manager()->MakeResourceCurrent();
}

bool FlutterWindowsView::ClearContext() {
return engine_->surface_manager()->ClearContext();
}

bool FlutterWindowsView::SwapBuffers() {
// Called on an engine-controlled (non-platform) thread.
std::unique_lock<std::mutex> lock(resize_mutex_);
Expand Down
11 changes: 6 additions & 5 deletions shell/platform/windows/flutter_windows_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ class FlutterWindowsView : public WindowBindingHandlerDelegate {
// Tells the engine to generate a new frame
void ForceRedraw();

// Callbacks for clearing context, settings context and swapping buffers,
// these are typically called on an engine-controlled (non-platform) thread.
bool ClearContext();
bool MakeCurrent();
bool MakeResourceCurrent();
// Swap the view's surface buffers. Must be called on the engine's raster
// thread. Returns true if the buffers were swapped.
//
// If the view is resizing, this returns false if the frame is not the target
// size. Otherwise, it unblocks the platform thread and blocks the raster
// thread until the v-blank.
bool SwapBuffers();

// Callback for presenting a software bitmap.
Expand Down