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

Side by Side Diff: ui/views/view.h

Issue 11087093: Migrate ui::Transform to gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Should pass trybots this time Created 8 years, 2 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
« no previous file with comments | « ui/gfx/transform_util_unittest.cc ('k') | ui/views/view.cc » ('j') | 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) 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 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 19 matching lines...) Expand all
30 #if defined(OS_WIN) 30 #if defined(OS_WIN)
31 #include "base/win/scoped_comptr.h" 31 #include "base/win/scoped_comptr.h"
32 #endif 32 #endif
33 33
34 using ui::OSExchangeData; 34 using ui::OSExchangeData;
35 35
36 namespace gfx { 36 namespace gfx {
37 class Canvas; 37 class Canvas;
38 class Insets; 38 class Insets;
39 class Path; 39 class Path;
40 class Transform;
40 } 41 }
41 42
42 namespace ui { 43 namespace ui {
43 struct AccessibleViewState; 44 struct AccessibleViewState;
44 class Compositor; 45 class Compositor;
45 class Layer; 46 class Layer;
46 class TextInputClient; 47 class TextInputClient;
47 class Texture; 48 class Texture;
48 class ThemeProvider; 49 class ThemeProvider;
49 class Transform;
50 } 50 }
51 51
52 #if defined(OS_WIN) 52 #if defined(OS_WIN)
53 class __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) 53 class __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
54 NativeViewAccessibilityWin; 54 NativeViewAccessibilityWin;
55 #endif 55 #endif
56 56
57 namespace views { 57 namespace views {
58 58
59 class Background; 59 class Background;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // color. This doesn't affect compositing but is a hint to the compositor to 253 // color. This doesn't affect compositing but is a hint to the compositor to
254 // optimize painting. 254 // optimize painting.
255 // Note that this method does not implicitly create a layer if one does not 255 // Note that this method does not implicitly create a layer if one does not
256 // already exist for the View, but is a no-op in that case. 256 // already exist for the View, but is a no-op in that case.
257 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); 257 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely);
258 258
259 // Transformations ----------------------------------------------------------- 259 // Transformations -----------------------------------------------------------
260 260
261 // Methods for setting transformations for a view (e.g. rotation, scaling). 261 // Methods for setting transformations for a view (e.g. rotation, scaling).
262 262
263 const ui::Transform& GetTransform() const; 263 const gfx::Transform& GetTransform() const;
264 264
265 // Clipping parameters. Clipping is done relative to the view bounds. 265 // Clipping parameters. Clipping is done relative to the view bounds.
266 void set_clip_insets(gfx::Insets clip_insets) { clip_insets_ = clip_insets; } 266 void set_clip_insets(gfx::Insets clip_insets) { clip_insets_ = clip_insets; }
267 267
268 // Sets the transform to the supplied transform. 268 // Sets the transform to the supplied transform.
269 void SetTransform(const ui::Transform& transform); 269 void SetTransform(const gfx::Transform& transform);
270 270
271 // Sets whether this view paints to a layer. A view paints to a layer if 271 // Sets whether this view paints to a layer. A view paints to a layer if
272 // either of the following are true: 272 // either of the following are true:
273 // . the view has a non-identity transform. 273 // . the view has a non-identity transform.
274 // . SetPaintToLayer(true) has been invoked. 274 // . SetPaintToLayer(true) has been invoked.
275 // View creates the Layer only when it exists in a Widget with a non-NULL 275 // View creates the Layer only when it exists in a Widget with a non-NULL
276 // Compositor. 276 // Compositor.
277 void SetPaintToLayer(bool paint_to_layer); 277 void SetPaintToLayer(bool paint_to_layer);
278 278
279 // Recreates a layer for the view and returns the old layer. After this call, 279 // Recreates a layer for the view and returns the old layer. After this call,
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 1224
1225 // Sets the layer's bounds given in DIP coordinates. 1225 // Sets the layer's bounds given in DIP coordinates.
1226 void SetLayerBounds(const gfx::Rect& bounds_in_dip); 1226 void SetLayerBounds(const gfx::Rect& bounds_in_dip);
1227 1227
1228 // Transformations ----------------------------------------------------------- 1228 // Transformations -----------------------------------------------------------
1229 1229
1230 // Returns in |transform| the transform to get from coordinates of |ancestor| 1230 // Returns in |transform| the transform to get from coordinates of |ancestor|
1231 // to this. Returns true if |ancestor| is found. If |ancestor| is not found, 1231 // to this. Returns true if |ancestor| is found. If |ancestor| is not found,
1232 // or NULL, |transform| is set to convert from root view coordinates to this. 1232 // or NULL, |transform| is set to convert from root view coordinates to this.
1233 bool GetTransformRelativeTo(const View* ancestor, 1233 bool GetTransformRelativeTo(const View* ancestor,
1234 ui::Transform* transform) const; 1234 gfx::Transform* transform) const;
1235 1235
1236 // Coordinate conversion ----------------------------------------------------- 1236 // Coordinate conversion -----------------------------------------------------
1237 1237
1238 // Convert a point in the view's coordinate to an ancestor view's coordinate 1238 // Convert a point in the view's coordinate to an ancestor view's coordinate
1239 // system using necessary transformations. Returns whether the point was 1239 // system using necessary transformations. Returns whether the point was
1240 // successfully converted to the ancestor's coordinate system. 1240 // successfully converted to the ancestor's coordinate system.
1241 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; 1241 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const;
1242 1242
1243 // Convert a point in the ancestor's coordinate system to the view's 1243 // Convert a point in the ancestor's coordinate system to the view's
1244 // coordinate system using necessary transformations. Returns whether the 1244 // coordinate system using necessary transformations. Returns whether the
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 base::win::ScopedComPtr<NativeViewAccessibilityWin> 1482 base::win::ScopedComPtr<NativeViewAccessibilityWin>
1483 native_view_accessibility_win_; 1483 native_view_accessibility_win_;
1484 #endif 1484 #endif
1485 1485
1486 DISALLOW_COPY_AND_ASSIGN(View); 1486 DISALLOW_COPY_AND_ASSIGN(View);
1487 }; 1487 };
1488 1488
1489 } // namespace views 1489 } // namespace views
1490 1490
1491 #endif // UI_VIEWS_VIEW_H_ 1491 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/gfx/transform_util_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698