OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_view.h" | 5 #include "views/widget/native_widget_view.h" |
6 | 6 |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 #if defined(OS_LINUX) | 8 #if defined(OS_LINUX) |
9 #include "views/window/hit_test.h" | 9 #include "views/window/hit_test.h" |
10 #endif | 10 #endif |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // NativeWidgetView, View overrides: | 45 // NativeWidgetView, View overrides: |
46 | 46 |
47 void NativeWidgetView::SchedulePaintInternal(const gfx::Rect& r) { | 47 void NativeWidgetView::SchedulePaintInternal(const gfx::Rect& r) { |
48 View::SchedulePaintInternal(r); | 48 View::SchedulePaintInternal(r); |
49 } | 49 } |
50 | 50 |
51 void NativeWidgetView::MarkLayerDirty() { | 51 void NativeWidgetView::MarkLayerDirty() { |
52 View::MarkLayerDirty(); | 52 View::MarkLayerDirty(); |
53 } | 53 } |
54 | 54 |
55 void NativeWidgetView::CalculateOffsetToAncestorWithLayer(gfx::Point* offset, | 55 void NativeWidgetView::CalculateOffsetToAncestorWithLayer( |
56 View** ancestor) { | 56 gfx::Point* offset, |
57 View::CalculateOffsetToAncestorWithLayer(offset, ancestor); | 57 ui::Layer** layer_parent) { |
| 58 View::CalculateOffsetToAncestorWithLayer(offset, layer_parent); |
58 } | 59 } |
59 | 60 |
60 void NativeWidgetView::ViewHierarchyChanged(bool is_add, | 61 void NativeWidgetView::ViewHierarchyChanged(bool is_add, |
61 View* parent, | 62 View* parent, |
62 View* child) { | 63 View* child) { |
63 if (is_add && child == this && !sent_create_) { | 64 if (is_add && child == this && !sent_create_) { |
64 sent_create_ = true; | 65 sent_create_ = true; |
65 delegate()->OnNativeWidgetCreated(); | 66 delegate()->OnNativeWidgetCreated(); |
66 } | 67 } |
67 } | 68 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 191 } |
191 | 192 |
192 void NativeWidgetView::UpdateLayerBounds(const gfx::Point& offset) { | 193 void NativeWidgetView::UpdateLayerBounds(const gfx::Point& offset) { |
193 View::UpdateLayerBounds(offset); | 194 View::UpdateLayerBounds(offset); |
194 if (!layer()) { | 195 if (!layer()) { |
195 gfx::Point new_offset(offset.x() + x(), offset.y() + y()); | 196 gfx::Point new_offset(offset.x() + x(), offset.y() + y()); |
196 GetAssociatedWidget()->GetRootView()->UpdateLayerBounds(new_offset); | 197 GetAssociatedWidget()->GetRootView()->UpdateLayerBounds(new_offset); |
197 } | 198 } |
198 } | 199 } |
199 | 200 |
200 void NativeWidgetView::PaintToLayer(const gfx::Rect& dirty_rect) { | |
201 View::PaintToLayer(dirty_rect); | |
202 | |
203 View* root = GetAssociatedWidget()->GetRootView(); | |
204 gfx::Rect root_dirty_rect = dirty_rect; | |
205 root->GetTransform().TransformRectReverse(&root_dirty_rect); | |
206 root_dirty_rect = | |
207 gfx::Rect(gfx::Point(), root->size()).Intersect(root_dirty_rect); | |
208 | |
209 if (!root_dirty_rect.IsEmpty()) | |
210 root->PaintToLayer(root_dirty_rect); | |
211 } | |
212 | |
213 void NativeWidgetView::PaintComposite() { | |
214 View::PaintComposite(); | |
215 GetAssociatedWidget()->GetRootView()->PaintComposite(); | |
216 } | |
217 | |
218 } // namespace internal | 201 } // namespace internal |
219 } // namespace views | 202 } // namespace views |
OLD | NEW |