OLD | NEW |
(Empty) | |
| 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 |
| 5 #ifndef VIEWS_PAINT_LOCK_H_ |
| 6 #define VIEWS_PAINT_LOCK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 |
| 11 namespace views { |
| 12 |
| 13 class View; |
| 14 |
| 15 // Instances of PaintLock can be created to disable painting of the view |
| 16 // (compositing is not disabled). When the class is destroyed, painting is |
| 17 // re-enabled. This can be useful during operations like animations, that are |
| 18 // sensitive to costly paints, and during which only composting, not painting, |
| 19 // is required. |
| 20 class PaintLock { |
| 21 public: |
| 22 // The paint lock does not own the view. It is an error for the view to be |
| 23 // destroyed before the lock. |
| 24 PaintLock(View* view); |
| 25 ~PaintLock(); |
| 26 |
| 27 private: |
| 28 View* view_; |
| 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(PaintLock); |
| 31 }; |
| 32 |
| 33 } // namespace views |
| 34 |
| 35 #endif // VIEWS_PAINT_LOCK_H_ |
OLD | NEW |