This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
add flag to identify sub-trees with PlatformViewLayers and always paint them #25824
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #include "flutter/flow/testing/mock_embedder.h" | ||
|
|
||
| namespace flutter { | ||
| namespace testing { | ||
|
|
||
| MockViewEmbedder::MockViewEmbedder() = default; | ||
|
|
||
| MockViewEmbedder::~MockViewEmbedder() = default; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| SkCanvas* MockViewEmbedder::GetRootCanvas() { | ||
| return nullptr; | ||
| } | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void MockViewEmbedder::CancelFrame() {} | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void MockViewEmbedder::BeginFrame( | ||
| SkISize frame_size, | ||
| GrDirectContext* context, | ||
| double device_pixel_ratio, | ||
| fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {} | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void MockViewEmbedder::PrerollCompositeEmbeddedView( | ||
| int view_id, | ||
| std::unique_ptr<EmbeddedViewParams> params) {} | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| std::vector<SkCanvas*> MockViewEmbedder::GetCurrentCanvases() { | ||
| return std::vector<SkCanvas*>({}); | ||
| } | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| SkCanvas* MockViewEmbedder::CompositeEmbeddedView(int view_id) { | ||
| return nullptr; | ||
| } | ||
|
|
||
| } // namespace testing | ||
| } // namespace flutter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #ifndef FLOW_TESTING_MOCK_EMBEDDER_H_ | ||
| #define FLOW_TESTING_MOCK_EMBEDDER_H_ | ||
|
|
||
| #include "flutter/flow/embedded_views.h" | ||
|
|
||
| namespace flutter { | ||
| namespace testing { | ||
|
|
||
| class MockViewEmbedder : public ExternalViewEmbedder { | ||
| public: | ||
| MockViewEmbedder(); | ||
|
|
||
| ~MockViewEmbedder(); | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| SkCanvas* GetRootCanvas() override; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void CancelFrame() override; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void BeginFrame( | ||
| SkISize frame_size, | ||
| GrDirectContext* context, | ||
| double device_pixel_ratio, | ||
| fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) override; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| void PrerollCompositeEmbeddedView( | ||
| int view_id, | ||
| std::unique_ptr<EmbeddedViewParams> params) override; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| std::vector<SkCanvas*> GetCurrentCanvases() override; | ||
|
|
||
| // |ExternalViewEmbedder| | ||
| SkCanvas* CompositeEmbeddedView(int view_id) override; | ||
| }; | ||
|
|
||
| } // namespace testing | ||
| } // namespace flutter | ||
|
|
||
| #endif // FLOW_TESTING_MOCK_EMBEDDER_H_ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Call this
TestViewEmbedderperhaps? This isn't really mocking anything else. It is an actualExternalViewEmbedder.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.
It's in the same space where we define other Mock objects that help with layer_unittests like mock_layer and mock_raster_cache and mock_texture. Over time it can provide more testing insights, but its first need is just to be a standin for having the view_embedder field of the context to be non-null.