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

Side by Side Diff: views/view.cc

Issue 7044062: Use SkMatrix44 for the underlying implementation of ui::Transform (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changed signature of TransformPoint -- now generic. Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« ui/gfx/point3.h ('K') | « ui/ui_unittests.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/view.h" 5 #include "views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "third_party/skia/include/core/SkRect.h" 13 #include "third_party/skia/include/core/SkRect.h"
14 #include "ui/base/accessibility/accessibility_types.h" 14 #include "ui/base/accessibility/accessibility_types.h"
15 #include "ui/base/dragdrop/drag_drop_types.h" 15 #include "ui/base/dragdrop/drag_drop_types.h"
16 #include "ui/gfx/canvas_skia.h" 16 #include "ui/gfx/canvas_skia.h"
17 #include "ui/gfx/compositor/compositor.h" 17 #include "ui/gfx/compositor/compositor.h"
18 #include "ui/gfx/path.h" 18 #include "ui/gfx/path.h"
19 #include "ui/gfx/point3.h"
19 #include "ui/gfx/transform.h" 20 #include "ui/gfx/transform.h"
20 #include "views/background.h" 21 #include "views/background.h"
21 #include "views/layout/layout_manager.h" 22 #include "views/layout/layout_manager.h"
22 #include "views/views_delegate.h" 23 #include "views/views_delegate.h"
23 #include "views/widget/native_widget.h" 24 #include "views/widget/native_widget.h"
24 #include "views/widget/root_view.h" 25 #include "views/widget/root_view.h"
25 #include "views/widget/tooltip_manager.h" 26 #include "views/widget/tooltip_manager.h"
26 #include "views/widget/widget.h" 27 #include "views/widget/widget.h"
27 28
28 #if defined(OS_WIN) 29 #if defined(OS_WIN)
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 ConvertPointFromWidget(dst, point); 1531 ConvertPointFromWidget(dst, point);
1531 } 1532 }
1532 } 1533 }
1533 } 1534 }
1534 1535
1535 bool View::ConvertPointForAncestor(const View* ancestor, 1536 bool View::ConvertPointForAncestor(const View* ancestor,
1536 gfx::Point* point) const { 1537 gfx::Point* point) const {
1537 ui::Transform trans; 1538 ui::Transform trans;
1538 // TODO(sad): Have some way of caching the transformation results. 1539 // TODO(sad): Have some way of caching the transformation results.
1539 bool result = GetTransformRelativeTo(ancestor, &trans); 1540 bool result = GetTransformRelativeTo(ancestor, &trans);
1540 trans.TransformPoint(point); 1541 gfx::Point3f p(*point);
1542 trans.TransformPoint(p);
1543 *point = p;
1541 return result; 1544 return result;
1542 } 1545 }
1543 1546
1544 bool View::ConvertPointFromAncestor(const View* ancestor, 1547 bool View::ConvertPointFromAncestor(const View* ancestor,
1545 gfx::Point* point) const { 1548 gfx::Point* point) const {
1546 ui::Transform trans; 1549 ui::Transform trans;
1547 bool result = GetTransformRelativeTo(ancestor, &trans); 1550 bool result = GetTransformRelativeTo(ancestor, &trans);
1548 trans.TransformPointReverse(point); 1551 gfx::Point3f p(*point);
1552 trans.TransformPointReverse(p);
1553 *point = p;
1549 return result; 1554 return result;
1550 } 1555 }
1551 1556
1552 // Accelerated painting -------------------------------------------------------- 1557 // Accelerated painting --------------------------------------------------------
1553 1558
1554 void View::MarkTextureDirty() { 1559 void View::MarkTextureDirty() {
1555 View* owner = this; 1560 View* owner = this;
1556 while (!((owner->transform_.get() && owner->transform_->HasChange()) || 1561 while (!((owner->transform_.get() && owner->transform_->HasChange()) ||
1557 owner->paint_to_texture_) && owner->parent_) 1562 owner->paint_to_texture_) && owner->parent_)
1558 owner = owner->parent_; 1563 owner = owner->parent_;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 result.append(GetChildViewAt(i)->PrintViewGraph(false)); 1833 result.append(GetChildViewAt(i)->PrintViewGraph(false));
1829 1834
1830 if (first) 1835 if (first)
1831 result.append("}\n"); 1836 result.append("}\n");
1832 1837
1833 return result; 1838 return result;
1834 } 1839 }
1835 #endif 1840 #endif
1836 1841
1837 } // namespace views 1842 } // namespace views
OLDNEW
« ui/gfx/point3.h ('K') | « ui/ui_unittests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698