-
Notifications
You must be signed in to change notification settings - Fork 6k
Prototype for partial repaint support for the Embedder API #34619
Conversation
shell/platform/embedder/embedder.h
Outdated
| /// damage in a self-contained way. | ||
| typedef struct { | ||
| /// The size of this struct. Must be sizeof(FlutterDamage). | ||
| size_t struct_size; |
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.
Any reason this should have a checked size? Given the way it's used in FlutterPresentInfo, the size of this struct can't ever be updated in a backwards compatible way because buffer_damage.damage will change its position.
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.
Oh I didn't think about that but it makes sense. I updated it now.
… down partial repaint information when creating a surface frame with acquire frame.
…implement GLContextSetDamageRegion.
…nd to avoid having to modify the return value of functions that are being used by other platforms.
abc2161 to
9db2299
Compare
examples/glfw/FlutterEmbedderGLFW.cc
Outdated
| SkIRect rect = {static_cast<int32_t>(flutter_rect.left), | ||
| static_cast<int32_t>(flutter_rect.right), | ||
| static_cast<int32_t>(flutter_rect.top), | ||
| static_cast<int32_t>(flutter_rect.bottom)}; |
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.
Should the right/bottom values be rounded up here?
examples/glfw/FlutterEmbedderGLFW.cc
Outdated
|
|
||
| std::array<EGLint, 4> static RectToInts(EGLDisplay display, | ||
| EGLSurface surface, | ||
| const SkIRect& rect) { |
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.
Rather than taking an SkIRect, maybe just take the FlutterRect and do the conversion inline?
examples/glfw/CMakeLists.txt
Outdated
| option(SKIA_INSTALL "" OFF) | ||
| add_subdirectory(${CMAKE_SOURCE_DIR}/../../../third_party/skia/out/config skia) | ||
| target_link_libraries(flutter_glfw skia) | ||
| include_directories(${CMAKE_SOURCE_DIR}/../../../third_party/skia) |
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.
To keep the build simple, I'd avoid building Skia here and just implement the rectangle behavior you need in the example.
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.
That sounds like a good approach! Thanks!
ff62d16 to
9a99192
Compare
|
@betrevisan Is this PR still on your radar? |
Hi @Hixie! My internship has already ended but if there is anything you would like me to take a look at, I'd be happy to help. |
|
@betrevisan That's entirely up to you, if you are interested in still contributing you are welcome to do so. :-) If you do not have the bandwidth that's totally understandable too; in that case should we close this PR? Is there an issue I should attach the PR to so that we don't forget the work you've done here? |
@Hixie this can be closed because it has already been implemented and merged in this PR here #35022. So this can be closed. |
This draft PR is a prototype of how one would add support for partial repaint to the Embedder API when using OpenGL.