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

Unified Diff: views/view.cc

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Address reviewer comments 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
« no previous file with comments | « views/view.h ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.cc
diff --git a/views/view.cc b/views/view.cc
index 22cdeb239fcb89f6b56760edb635ff1b76b0f18c..fff23866095db31757fe0d1b572d8cd26b264079 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"
@@ -104,6 +105,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),
@@ -680,7 +682,7 @@ void View::SchedulePaint() {
}
void View::SchedulePaintInRect(const gfx::Rect& rect) {
- if (!IsVisible())
+ if (!IsVisible() || !painting_enabled_)
return;
MarkLayerDirty();
@@ -688,7 +690,8 @@ void View::SchedulePaintInRect(const gfx::Rect& rect) {
}
void View::Paint(gfx::Canvas* canvas) {
- if (!IsVisible())
+ TRACE_EVENT0("View", "Paint");
+ if (!IsVisible() || !painting_enabled_)
return;
ScopedCanvas scoped_canvas(NULL);
@@ -1168,7 +1171,7 @@ void View::PaintComposite() {
}
void View::SchedulePaintInternal(const gfx::Rect& rect) {
- if (parent_ && parent_->IsVisible()) {
+ if (parent_ && parent_->IsVisible() && painting_enabled_) {
// Translate the requested paint rect to the parent's coordinate system
// then pass this notification up to the parent.
parent_->SchedulePaintInternal(ConvertRectToParent(rect));
« no previous file with comments | « views/view.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698