This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #include " impeller/aiks/testing/context_mock.h"
6
+ #include < memory>
7
+
8
+ namespace impeller {
9
+ namespace testing {
10
+
11
+ std::shared_ptr<ContextMock> ContextMock::Make () {
12
+ return std::make_shared<::testing::NiceMock<ContextMock>>();
13
+ }
14
+
15
+ } // namespace testing
16
+
17
+ } // namespace impeller
Original file line number Diff line number Diff line change @@ -971,7 +971,9 @@ bool EntityPass::OnRender(
971
971
// everything and disrupt the optimization.
972
972
!backdrop_filter_proc_;
973
973
974
- // Count the number of elements eaten by the clear color optimization.
974
+ // Count the number of elements eaten by the clear color optimization. Break
975
+ // it down in terms of opaque and translucent elements so that we can skip
976
+ // over these entities when applying the clear color optimization.
975
977
size_t opaque_clear_entity_count = 0 ;
976
978
size_t translucent_clear_entity_count = 0 ;
977
979
if (should_collapse_clear_colors) {
@@ -985,10 +987,14 @@ bool EntityPass::OnRender(
985
987
} else {
986
988
translucent_clear_entity_count++;
987
989
}
990
+ // We've found an entity that replaces the whole background color of
991
+ // this layer, so continue counting.
988
992
continue ;
989
993
}
990
- break ;
991
994
}
995
+ // We came across an element that doesn't replace the background color of
996
+ // this layer, so stop counting.
997
+ break ;
992
998
}
993
999
}
994
1000
You can’t perform that action at this time.
0 commit comments