OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 const gfx::Rect& Window::bounds() const { | 205 const gfx::Rect& Window::bounds() const { |
206 return layer_->bounds(); | 206 return layer_->bounds(); |
207 } | 207 } |
208 | 208 |
209 void Window::SchedulePaintInRect(const gfx::Rect& rect) { | 209 void Window::SchedulePaintInRect(const gfx::Rect& rect) { |
210 layer_->SchedulePaint(rect); | 210 layer_->SchedulePaint(rect); |
211 FOR_EACH_OBSERVER( | 211 FOR_EACH_OBSERVER( |
212 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); | 212 WindowObserver, observers_, OnWindowPaintScheduled(this, rect)); |
213 } | 213 } |
214 | 214 |
215 void Window::SetCanvas(const SkCanvas& canvas, const gfx::Point& origin) { | |
216 // TODO: figure out how this is going to work when animating the layer. In | |
217 // particular if we're animating the size then the underlying Texture is going | |
218 // to be unhappy if we try to set a texture on a size bigger than the size of | |
219 // the texture. | |
220 layer_->SetCanvas(canvas, origin); | |
221 gfx::Rect region(gfx::Point(), bounds().size()); | |
222 FOR_EACH_OBSERVER( | |
223 WindowObserver, observers_, OnWindowPaintScheduled(this, region)); | |
224 } | |
225 | |
226 void Window::SetExternalTexture(ui::Texture* texture) { | 215 void Window::SetExternalTexture(ui::Texture* texture) { |
227 layer_->SetExternalTexture(texture); | 216 layer_->SetExternalTexture(texture); |
228 gfx::Rect region(gfx::Point(), bounds().size()); | 217 gfx::Rect region(gfx::Point(), bounds().size()); |
229 FOR_EACH_OBSERVER( | 218 FOR_EACH_OBSERVER( |
230 WindowObserver, observers_, OnWindowPaintScheduled(this, region)); | 219 WindowObserver, observers_, OnWindowPaintScheduled(this, region)); |
231 } | 220 } |
232 | 221 |
233 void Window::SetParent(Window* parent) { | 222 void Window::SetParent(Window* parent) { |
234 GetParentForWindow(this, parent)->AddChild(this); | 223 GetParentForWindow(this, parent)->AddChild(this); |
235 } | 224 } |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 parent_->children().end(), | 660 parent_->children().end(), |
672 this); | 661 this); |
673 for (++i; i != parent_->children().end(); ++i) { | 662 for (++i; i != parent_->children().end(); ++i) { |
674 if ((*i)->StopsEventPropagation()) | 663 if ((*i)->StopsEventPropagation()) |
675 return true; | 664 return true; |
676 } | 665 } |
677 return false; | 666 return false; |
678 } | 667 } |
679 | 668 |
680 } // namespace aura | 669 } // namespace aura |
OLD | NEW |