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 #ifndef UI_GFX_CANVAS_H_ | 5 #ifndef UI_GFX_CANVAS_H_ |
6 #define UI_GFX_CANVAS_H_ | 6 #define UI_GFX_CANVAS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SHOW_PREFIX = 1 << 7, | 69 SHOW_PREFIX = 1 << 7, |
70 HIDE_PREFIX = 1 << 8, | 70 HIDE_PREFIX = 1 << 8, |
71 | 71 |
72 // Prevent ellipsizing | 72 // Prevent ellipsizing |
73 NO_ELLIPSIS = 1 << 9, | 73 NO_ELLIPSIS = 1 << 9, |
74 | 74 |
75 // Specifies if words can be split by new lines. | 75 // Specifies if words can be split by new lines. |
76 // This only works with MULTI_LINE. | 76 // This only works with MULTI_LINE. |
77 CHARACTER_BREAK = 1 << 10, | 77 CHARACTER_BREAK = 1 << 10, |
78 | 78 |
79 // Instructs DrawStringInt() to render the text using RTL directionality. | |
80 // In most cases, passing this flag is not necessary because information | |
81 // about the text directionality is going to be embedded within the string | |
82 // in the form of special Unicode characters. However, we don't insert | |
83 // directionality characters into strings if the locale is LTR because some | |
84 // platforms (for example, an English Windows XP with no RTL fonts | |
85 // installed) don't support these characters. Thus, this flag should be | |
86 // used to render text using RTL directionality when the locale is LTR. | |
87 FORCE_RTL_DIRECTIONALITY = 1 << 11, | |
88 | |
89 // Similar to FORCE_RTL_DIRECTIONALITY, but left-to-right. | |
90 // See FORCE_RTL_DIRECTIONALITY for details. | |
91 FORCE_LTR_DIRECTIONALITY = 1 << 12, | |
92 | |
93 // Instructs DrawStringInt() to not use subpixel rendering. This is useful | 79 // Instructs DrawStringInt() to not use subpixel rendering. This is useful |
94 // when rendering text onto a fully- or partially-transparent background | 80 // when rendering text onto a fully- or partially-transparent background |
95 // that will later be blended with another image. | 81 // that will later be blended with another image. |
96 NO_SUBPIXEL_RENDERING = 1 << 13, | 82 NO_SUBPIXEL_RENDERING = 1 << 11, |
97 }; | 83 }; |
98 | 84 |
99 // Creates an empty canvas with scale factor of 1x. | 85 // Creates an empty canvas with scale factor of 1x. |
100 Canvas(); | 86 Canvas(); |
101 | 87 |
102 // Creates canvas with provided DIP |size| and |scale_factor|. | 88 // Creates canvas with provided DIP |size| and |scale_factor|. |
103 // If this canvas is not opaque, it's explicitly cleared to transparent before | 89 // If this canvas is not opaque, it's explicitly cleared to transparent before |
104 // being returned. | 90 // being returned. |
105 Canvas(const gfx::Size& size, | 91 Canvas(const gfx::Size& size, |
106 ui::ScaleFactor scale_factor, | 92 ui::ScaleFactor scale_factor, |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 388 |
403 scoped_ptr<skia::PlatformCanvas> owned_canvas_; | 389 scoped_ptr<skia::PlatformCanvas> owned_canvas_; |
404 SkCanvas* canvas_; | 390 SkCanvas* canvas_; |
405 | 391 |
406 DISALLOW_COPY_AND_ASSIGN(Canvas); | 392 DISALLOW_COPY_AND_ASSIGN(Canvas); |
407 }; | 393 }; |
408 | 394 |
409 } // namespace gfx | 395 } // namespace gfx |
410 | 396 |
411 #endif // UI_GFX_CANVAS_H_ | 397 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |