summaryrefslogtreecommitdiffstats
path: root/ui/views/paint_lock.h
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 16:09:33 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 16:09:33 +0000
commit45647af87d1e7e5ed607c6fd82a1ac32a708a725 (patch)
tree258381d5b333c5749616d97c1fe3a6bc4db50e1d /ui/views/paint_lock.h
parentab91de22a8a7eef73958b0b4463de89bd7fdbd12 (diff)
downloadchromium_src-45647af87d1e7e5ed607c6fd82a1ac32a708a725.zip
chromium_src-45647af87d1e7e5ed607c6fd82a1ac32a708a725.tar.gz
chromium_src-45647af87d1e7e5ed607c6fd82a1ac32a708a725.tar.bz2
views: Move the remaining file from views/ to ui/views/.
BUG=104039 R=ben@chromium.org TBR=stevenjb@chromium.org Review URL: http://codereview.chromium.org/8771006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/paint_lock.h')
-rw-r--r--ui/views/paint_lock.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/ui/views/paint_lock.h b/ui/views/paint_lock.h
new file mode 100644
index 0000000..41e3083
--- /dev/null
+++ b/ui/views/paint_lock.h
@@ -0,0 +1,36 @@
+// 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 UI_VIEWS_PAINT_LOCK_H_
+#define UI_VIEWS_PAINT_LOCK_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "ui/views/views_export.h"
+
+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 VIEWS_EXPORT PaintLock {
+ public:
+ // The paint lock does not own the view. It is an error for the view to be
+ // destroyed before the lock.
+ PaintLock(View* view);
+ ~PaintLock();
+
+ private:
+ View* view_;
+
+ DISALLOW_COPY_AND_ASSIGN(PaintLock);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_PAINT_LOCK_H_