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

Unified Diff: ui/gfx/compositor/layer.cc

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move compositing notifications to Layer 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
Index: ui/gfx/compositor/layer.cc
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index 4f1ed24116ddf018cbb063be3a3d1d96eb190494..897c011ec3f05bd64712e7d9d8adda232749751e 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/logging.h"
+#include "ui/gfx/compositor/layer_observer.h"
#include "ui/gfx/point3.h"
namespace ui {
@@ -108,6 +109,14 @@ void Layer::SetCanvas(const SkCanvas& canvas, const gfx::Point& origin) {
texture_->SetCanvas(canvas, origin, bounds_.size());
}
+void Layer::AddObserver(LayerObserver* observer) {
+ observer_list_.AddObserver(observer);
+}
+
+void Layer::RemoveObserver(LayerObserver* observer) {
+ observer_list_.RemoveObserver(observer);
+}
+
void Layer::Draw() {
ui::TextureDrawParams texture_draw_params;
for (Layer* layer = this; layer; layer = layer->parent_) {
@@ -152,6 +161,7 @@ void Layer::Draw() {
bounds_.width(),
bounds_.height() - hole_rect_.bottom()));
#endif
+ FOR_EACH_OBSERVER(LayerObserver, observer_list_, OnDraw(this));
}
void Layer::DrawRegion(const ui::TextureDrawParams& params,
« no previous file with comments | « ui/gfx/compositor/layer.h ('k') | ui/gfx/compositor/layer_observer.h » ('j') | views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698