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

Unified Diff: ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm

Issue 2479723003: Mac: Fix flickering while entering/leaving fullscreen low power video (Closed)
Patch Set: Created 4 years, 1 month 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 | « ui/accelerated_widget_mac/ca_layer_tree_coordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
diff --git a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
index 187983ca1730c97211c0970266d952744ff4f7bf..e8a8dc40839a60983f0b0adee78be93dfe79c52f 100644
--- a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
+++ b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
@@ -12,6 +12,10 @@
namespace ui {
+namespace {
+const uint64_t kFramesBeforeFlushingLowPowerLayer = 15;
+}
+
CALayerTreeCoordinator::CALayerTreeCoordinator(
bool allow_remote_layers,
bool allow_av_sample_buffer_display_layer)
@@ -96,14 +100,15 @@
current_ca_renderer_layer_tree_.reset();
}
- // TODO(ccameron): It may be necessary to leave the last image up for a few
- // extra frames to allow a smooth switch between the normal and low-power
- // NSWindows.
- if (current_fullscreen_low_power_layer_valid_ &&
- !*fullscreen_low_power_layer_valid) {
+ // It is necessary to leave the last image up for a few extra frames to allow
+ // a smooth switch between the normal and low-power NSWindows.
+ if (*fullscreen_low_power_layer_valid)
+ frames_since_low_power_layer_was_valid_ = 0;
+ else
+ frames_since_low_power_layer_was_valid_ += 1;
+ if (frames_since_low_power_layer_was_valid_ ==
+ kFramesBeforeFlushingLowPowerLayer)
[fullscreen_low_power_layer_ flushAndRemoveImage];
- }
- current_fullscreen_low_power_layer_valid_ = *fullscreen_low_power_layer_valid;
// Reset all state for the next frame.
pending_ca_renderer_layer_tree_.reset();
« no previous file with comments | « ui/accelerated_widget_mac/ca_layer_tree_coordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698