-
Notifications
You must be signed in to change notification settings - Fork 6k
[Windows] Refactor logic when window resize completes #49872
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,7 +154,12 @@ bool CompositorOpenGL::Present(const FlutterLayer** layers, | |
GL_NEAREST // filter | ||
); | ||
|
||
return engine_->view()->SwapBuffers(); | ||
if (!engine_->surface_manager()->SwapBuffers()) { | ||
return false; | ||
} | ||
|
||
engine_->view()->OnFramePresented(); | ||
return true; | ||
Comment on lines
+157
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be refactored into a separate function? It looks like this and the below addition to this file are identical. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right that they're identical, but I think the logic is short enough that it's okay to repeat. I don't feel super strongly about this though, let me know if you do and I'd be happy to update this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a thought. I don't think it's too important either way. |
||
} | ||
|
||
bool CompositorOpenGL::Initialize() { | ||
|
@@ -188,7 +193,12 @@ bool CompositorOpenGL::ClearSurface() { | |
gl_->ClearColor(0.0f, 0.0f, 0.0f, 0.0f); | ||
gl_->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | ||
|
||
return engine_->view()->SwapBuffers(); | ||
if (!engine_->surface_manager()->SwapBuffers()) { | ||
return false; | ||
} | ||
|
||
engine_->view()->OnFramePresented(); | ||
return true; | ||
} | ||
|
||
} // namespace flutter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anytime we can avoid leaking implementation details (including types) from behind interfaces, it's a nice plus. Users of our surface managers shouldn't need to know about the underlying usage of GL types.