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

Unified Diff: views/animation/paint_lock.h

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Moved screen rotation code under touch; use lock object to disable painting Created 9 years, 4 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
Index: views/animation/paint_lock.h
diff --git a/views/animation/paint_lock.h b/views/animation/paint_lock.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3463a8afe254f6f99cf3deafe4a6c575b5a9b63
--- /dev/null
+++ b/views/animation/paint_lock.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VIEWS_ANIMATION_PAINT_LOCK_H_
+#define VIEWS_ANIMATION_PAINT_LOCK_H_
+#pragma once
+
+namespace views {
+
+class View;
+
+// Instances of PaintLock can be created to disable painting of the view
+// (compositing is not disabled). When the class is destroyed, painting is
+// re-enabled. This can be useful during operations like animations, that are
+// sensitive to costly paints, and during which only composting, not painting,
+// is required.
+class PaintLock {
+ public:
+ // The paint lock does not own the view. It is an error for the view to be
+ // destroed before the lock.
sky 2011/08/25 21:10:12 destroed -> destroyed.
+ PaintLock(View* view);
+ ~PaintLock();
+ private:
sky 2011/08/25 21:10:12 nit: newline between 23 and 24.
+ View* view_;
+};
sky 2011/08/25 21:10:12 DISALLOW_COPY_AND_ASSIGN.
+
+} // namespace views
+
+#endif // VIEWS_ANIMATION_PAINT_LOCK_H_

Powered by Google App Engine
This is Rietveld 408576698