[Impeller] made window size parametric in playground/golden tests (flutter/engine#46682)

In https://github.com/flutter/flutter/issues/136058#issuecomment-1751507094 it was seen that some bugs manifest only with viewports of certain sizes.  This allows writers of tests to adjust the window size for playgrounds and golden image tests.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
gaaclarke
2023-10-10 09:10:12 -07:00
committed by GitHub
parent d04f82ecb8
commit de5300d6df
4 changed files with 11 additions and 2 deletions

View File

@@ -57,6 +57,9 @@ class GoldenPlaygroundTest
ISize GetWindowSize() const;
protected:
void SetWindowSize(ISize size);
private:
#if FML_OS_MACOSX
// This must be placed first so that the autorelease pool is not destroyed

View File

@@ -194,4 +194,8 @@ ISize GoldenPlaygroundTest::GetWindowSize() const {
return pimpl_->window_size;
}
void GoldenPlaygroundTest::GoldenPlaygroundTest::SetWindowSize(ISize size) {
pimpl_->window_size = size;
}
} // namespace impeller

View File

@@ -64,4 +64,6 @@ ISize GoldenPlaygroundTest::GetWindowSize() const {
return ISize();
}
void GoldenPlaygroundTest::SetWindowSize(ISize size) {}
} // namespace impeller

View File

@@ -92,6 +92,8 @@ class Playground {
virtual bool ShouldKeepRendering() const;
void SetWindowSize(ISize size);
private:
struct GLFWInitializer;
@@ -105,8 +107,6 @@ class Playground {
void SetCursorPosition(Point pos);
void SetWindowSize(ISize size);
FML_DISALLOW_COPY_AND_ASSIGN(Playground);
};