Commit 73b45377 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Remove unused PaintLock API.

R=ben@chromium.org
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/10835027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149189 0039d316-1c4b-4281-b951-d872f2087c98
parent 98a51c0c
// 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.
#include "ui/views/paint_lock.h"
#include "ui/views/view.h"
namespace views {
PaintLock::PaintLock(View* view) : view_(view) {
view_->set_painting_enabled(false);
}
PaintLock::~PaintLock() {
view_->set_painting_enabled(true);
}
} // namespace views
// Copyright (c) 2012 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_
#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.
explicit PaintLock(View* view);
~PaintLock();
private:
View* view_;
DISALLOW_COPY_AND_ASSIGN(PaintLock);
};
} // namespace views
#endif // UI_VIEWS_PAINT_LOCK_H_
...@@ -102,7 +102,6 @@ View::View() ...@@ -102,7 +102,6 @@ View::View()
parent_(NULL), parent_(NULL),
visible_(true), visible_(true),
enabled_(true), enabled_(true),
painting_enabled_(true),
notify_enter_exit_on_child_(false), notify_enter_exit_on_child_(false),
registered_for_visible_bounds_notification_(false), registered_for_visible_bounds_notification_(false),
clip_insets_(0, 0, 0, 0), clip_insets_(0, 0, 0, 0),
...@@ -690,7 +689,7 @@ void View::SchedulePaint() { ...@@ -690,7 +689,7 @@ void View::SchedulePaint() {
} }
void View::SchedulePaintInRect(const gfx::Rect& rect) { void View::SchedulePaintInRect(const gfx::Rect& rect) {
if (!visible_ || !painting_enabled_) if (!visible_)
return; return;
if (layer()) { if (layer()) {
...@@ -1501,7 +1500,7 @@ void View::SchedulePaintBoundsChanged(SchedulePaintType type) { ...@@ -1501,7 +1500,7 @@ void View::SchedulePaintBoundsChanged(SchedulePaintType type) {
} }
void View::PaintCommon(gfx::Canvas* canvas) { void View::PaintCommon(gfx::Canvas* canvas) {
if (!visible_ || !painting_enabled_) if (!visible_)
return; return;
{ {
......
...@@ -1114,7 +1114,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, ...@@ -1114,7 +1114,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
friend class internal::RootView; friend class internal::RootView;
friend class FocusManager; friend class FocusManager;
friend class Widget; friend class Widget;
friend class PaintLock;
// Used to track a drag. RootView passes this into // Used to track a drag. RootView passes this into
// ProcessMousePressed/Dragged. // ProcessMousePressed/Dragged.
...@@ -1238,11 +1237,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, ...@@ -1238,11 +1237,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Accelerated painting ------------------------------------------------------ // Accelerated painting ------------------------------------------------------
// Disables painting during time critical operations. Used by PaintLock.
// TODO(vollick) Ideally, the widget would not dispatch paints into the
// hierarchy during time critical operations and this would not be needed.
void set_painting_enabled(bool enabled) { painting_enabled_ = enabled; }
// Creates the layer and related fields for this view. // Creates the layer and related fields for this view.
void CreateLayer(); void CreateLayer();
...@@ -1372,9 +1366,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, ...@@ -1372,9 +1366,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Whether this view is enabled. // Whether this view is enabled.
bool enabled_; bool enabled_;
// Whether this view is painting.
bool painting_enabled_;
// When this flag is on, a View receives a mouse-enter and mouse-leave event // When this flag is on, a View receives a mouse-enter and mouse-leave event
// even if a descendant View is the event-recipient for the real mouse // even if a descendant View is the event-recipient for the real mouse
// events. When this flag is turned on, and mouse moves from outside of the // events. When this flag is turned on, and mouse moves from outside of the
......
...@@ -293,8 +293,6 @@ ...@@ -293,8 +293,6 @@
'native_theme_delegate.h', 'native_theme_delegate.h',
'native_theme_painter.cc', 'native_theme_painter.cc',
'native_theme_painter.h', 'native_theme_painter.h',
'paint_lock.cc',
'paint_lock.h',
'painter.cc', 'painter.cc',
'painter.h', 'painter.h',
'repeat_controller.cc', 'repeat_controller.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment