[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:
@@ -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
|
||||
|
||||
@@ -194,4 +194,8 @@ ISize GoldenPlaygroundTest::GetWindowSize() const {
|
||||
return pimpl_->window_size;
|
||||
}
|
||||
|
||||
void GoldenPlaygroundTest::GoldenPlaygroundTest::SetWindowSize(ISize size) {
|
||||
pimpl_->window_size = size;
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -64,4 +64,6 @@ ISize GoldenPlaygroundTest::GetWindowSize() const {
|
||||
return ISize();
|
||||
}
|
||||
|
||||
void GoldenPlaygroundTest::SetWindowSize(ISize size) {}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user