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

Unified Diff: chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h

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 | « no previous file | chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h
diff --git a/chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h b/chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h
index 9c33684febd90803670d93e73dea60af723161e6..381408c357e635f7befee731e43ff8125de93c89 100644
--- a/chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h
+++ b/chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h
@@ -42,6 +42,9 @@ class FullscreenLowPowerCoordinatorCocoa
void SetLowPowerLayerValid(bool valid) override;
void WillLoseAcceleratedWidget() override;
+ // Call EnterOrExitLowPowerModeIfNeeded to wind down counters.
+ void TickEnterOrExitForTesting();
+
private:
// Determine if we should be fullscreen low power mode, and enter or exit
// the mode as needed.
@@ -61,11 +64,9 @@ class FullscreenLowPowerCoordinatorCocoa
// transitioned to low power mode.
bool allowed_by_fullscreen_transition_ = false;
- // Set by the AcceleratedWidgetHost with each frame. This must be true for
- // 15 consecutive frames to enter low power mode (this is to ensure that the
- // low power window has actually updated to the correct content before it
- // appears).
- uint64_t low_power_layer_valid_frame_count_ = 0;
+ // Set by the AcceleratedWidgetHost with each frame to indicate if the low
+ // power layer's contents are valid.
+ bool low_power_layer_valid_ = false;
// Set if the NSView hierarchy allows low power mode. Low power mode is only
// allowed when nothing but the web contents is on-screen.
@@ -80,7 +81,17 @@ class FullscreenLowPowerCoordinatorCocoa
bool allowed_by_active_sheet_ = false;
// Updated by EnterOrExitLowPowerModeIfNeeded.
- bool in_low_power_mode_ = false;
+ enum State {
+ // The fullscreen low power window is hidden behind the main window.
+ Disabled,
+ // The fullscreen low power window is still hidden, but is counting up
+ // transition frames before showing itself.
+ WarmingUp,
+ // The fullscreen low power window is in front of the main window.
+ Enabled,
+ };
+ State state_ = Disabled;
+ uint64_t frames_in_state_ = 0;
};
#endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_LOW_POWER_COORDINATOR_H_
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698