Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2902)

Unified Diff: cc/output/overlay_unittest.cc

Issue 2844483004: Reset the state of the previous frame if overlay processing is skipped. (Closed)
Patch Set: Reset the state of the previous frame if hardware overlay processing is skipped. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/overlay_processor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/overlay_unittest.cc
diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc
index 70d81f6fc6b5b91cad316212a151b30d23c6c814..6d5f36205742d7cd30d3778665578c5c49122e49 100644
--- a/cc/output/overlay_unittest.cc
+++ b/cc/output/overlay_unittest.cc
@@ -1398,6 +1398,38 @@ TEST_F(UnderlayTest, DamageNotSubtractedForNonIdenticalConsecutiveUnderlays) {
}
}
+// Underlay damage can only be subtracted if the previous frame's underlay
+// exists.
+TEST_F(UnderlayTest, DamageNotSubtractedForNonConsecutiveIdenticalUnderlays) {
+ bool has_fullscreen_candidate[] = {true, false, true};
+
+ for (int i = 0; i < 3; ++i) {
+ std::unique_ptr<RenderPass> pass = CreateRenderPass();
+
+ if (has_fullscreen_candidate[i]) {
+ CreateFullscreenCandidateQuad(resource_provider_.get(),
+ pass->shared_quad_state_list.back(),
+ pass.get());
+ }
+
+ damage_rect_ = kOverlayRect;
+
+ // Add something behind it.
+ CreateFullscreenOpaqueQuad(resource_provider_.get(),
+ pass->shared_quad_state_list.back(), pass.get());
+
+ OverlayCandidateList candidate_list;
+ base::flat_map<int, FilterOperations*> render_pass_filters;
+ base::flat_map<int, FilterOperations*> render_pass_background_filters;
+ overlay_processor_->ProcessForOverlays(
+ resource_provider_.get(), pass.get(), render_pass_filters,
+ render_pass_background_filters, &candidate_list, nullptr, nullptr,
+ &damage_rect_, &content_bounds_);
+ }
+
+ EXPECT_EQ(kOverlayRect, damage_rect_);
+}
+
TEST_F(UnderlayTest, DamageNotSubtractedWhenQuadsAboveOverlap) {
for (int i = 0; i < 2; ++i) {
std::unique_ptr<RenderPass> pass = CreateRenderPass();
« no previous file with comments | « cc/output/overlay_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698