Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 32ea381

Browse files
committed
const ref
1 parent aa0ec10 commit 32ea381

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

shell/common/rasterizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Rasterizer final : public SnapshotDelegate,
121121
virtual const Settings& GetSettings() const = 0;
122122

123123
virtual bool ShouldDiscardLayerTree(int64_t view_id,
124-
flutter::LayerTree& tree) = 0;
124+
const flutter::LayerTree& tree) = 0;
125125
};
126126

127127
//----------------------------------------------------------------------------

shell/common/rasterizer_unittests.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class MockDelegate : public Rasterizer::Delegate {
4343
MOCK_CONST_METHOD0(GetIsGpuDisabledSyncSwitch,
4444
std::shared_ptr<const fml::SyncSwitch>());
4545
MOCK_CONST_METHOD0(GetSettings, const Settings&());
46-
MOCK_METHOD2(ShouldDiscardLayerTree, bool(int64_t, flutter::LayerTree&));
46+
MOCK_METHOD2(ShouldDiscardLayerTree,
47+
bool(int64_t, const flutter::LayerTree&));
4748
};
4849

4950
class MockSurface : public Surface {

shell/common/shell.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,8 @@ fml::TimePoint Shell::GetLatestFrameTargetTime() const {
15841584
}
15851585

15861586
// |Rasterizer::Delegate|
1587-
bool Shell::ShouldDiscardLayerTree(int64_t view_id, flutter::LayerTree& tree) {
1587+
bool Shell::ShouldDiscardLayerTree(int64_t view_id,
1588+
const flutter::LayerTree& tree) {
15881589
std::scoped_lock<std::mutex> lock(resize_mutex_);
15891590
auto expected_frame_size = ExpectedFrameSize(view_id);
15901591
return !expected_frame_size.isEmpty() &&

shell/common/shell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ class Shell final : public PlatformView::Delegate,
695695

696696
// |Rasterizer::Delegate|
697697
bool ShouldDiscardLayerTree(int64_t view_id,
698-
flutter::LayerTree& tree) override;
698+
const flutter::LayerTree& tree) override;
699699

700700
// |ServiceProtocol::Handler|
701701
fml::RefPtr<fml::TaskRunner> GetServiceProtocolHandlerTaskRunner(

0 commit comments

Comments
 (0)