scoped_cocoa_disable_screen_updates.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright (c) 2011 The Chromium 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. #ifndef UI_GFX_MAC_SCOPED_COCOA_DISABLE_SCREEN_UPDATES_H_
  5. #define UI_GFX_MAC_SCOPED_COCOA_DISABLE_SCREEN_UPDATES_H_
  6. #include "ui/gfx/gfx_export.h"
  7. namespace gfx {
  8. // A stack-based class to disable Cocoa screen updates. When instantiated, it
  9. // disables screen updates and enables them when destroyed. Update disabling
  10. // can be nested, and there is a time-maximum (about 1 second) after which
  11. // Cocoa will automatically re-enable updating. This class doesn't attempt to
  12. // overrule that.
  13. class GFX_EXPORT ScopedCocoaDisableScreenUpdates {
  14. public:
  15. ScopedCocoaDisableScreenUpdates();
  16. ScopedCocoaDisableScreenUpdates(const ScopedCocoaDisableScreenUpdates&) =
  17. delete;
  18. ScopedCocoaDisableScreenUpdates& operator=(
  19. const ScopedCocoaDisableScreenUpdates&) = delete;
  20. ~ScopedCocoaDisableScreenUpdates();
  21. };
  22. } // namespace gfx
  23. #endif // UI_GFX_MAC_SCOPED_COCOA_DISABLE_SCREEN_UPDATES_H_