Index: views/view.cc |
diff --git a/views/view.cc b/views/view.cc |
index 75a93b1f4602f55fc203202937bc158a52184f42..444068f73d188d6dbff8ff341629090ae7c3c143 100644 |
--- a/views/view.cc |
+++ b/views/view.cc |
@@ -6,6 +6,7 @@ |
#include <algorithm> |
+#include "base/debug/trace_event.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
@@ -107,6 +108,7 @@ View::View() |
parent_(NULL), |
visible_(true), |
enabled_(true), |
+ painting_enabled_(true), |
registered_for_visible_bounds_notification_(false), |
clip_x_(0.0), |
clip_y_(0.0), |
@@ -685,7 +687,7 @@ void View::SchedulePaint() { |
} |
void View::SchedulePaintInRect(const gfx::Rect& rect) { |
- if (!IsVisible()) |
+ if (!IsVisible() || !painting_enabled_) |
return; |
MarkLayerDirty(); |
@@ -693,7 +695,8 @@ void View::SchedulePaintInRect(const gfx::Rect& rect) { |
} |
void View::Paint(gfx::Canvas* canvas) { |
- if (!IsVisible()) |
+ TRACE_EVENT0("View", "Paint"); |
+ if (!IsVisible() || !painting_enabled_) |
sky
2011/08/25 21:10:12
You also need to update SchedulePaintInternal.
|
return; |
ScopedCanvas scoped_canvas(NULL); |