| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 SHOW_PREFIX = 1 << 7, | 71 SHOW_PREFIX = 1 << 7, |
| 72 HIDE_PREFIX = 1 << 8, | 72 HIDE_PREFIX = 1 << 8, |
| 73 | 73 |
| 74 // Prevent ellipsizing | 74 // Prevent ellipsizing |
| 75 NO_ELLIPSIS = 1 << 9, | 75 NO_ELLIPSIS = 1 << 9, |
| 76 | 76 |
| 77 // Specifies if words can be split by new lines. | 77 // Specifies if words can be split by new lines. |
| 78 // This only works with MULTI_LINE. | 78 // This only works with MULTI_LINE. |
| 79 CHARACTER_BREAK = 1 << 10, | 79 CHARACTER_BREAK = 1 << 10, |
| 80 | 80 |
| 81 // Instructs DrawStringInt() to render the text using RTL directionality. | |
| 82 // In most cases, passing this flag is not necessary because information | |
| 83 // about the text directionality is going to be embedded within the string | |
| 84 // in the form of special Unicode characters. However, we don't insert | |
| 85 // directionality characters into strings if the locale is LTR because some | |
| 86 // platforms (for example, an English Windows XP with no RTL fonts | |
| 87 // installed) don't support these characters. Thus, this flag should be | |
| 88 // used to render text using RTL directionality when the locale is LTR. | |
| 89 FORCE_RTL_DIRECTIONALITY = 1 << 11, | |
| 90 | |
| 91 // Similar to FORCE_RTL_DIRECTIONALITY, but left-to-right. | |
| 92 // See FORCE_RTL_DIRECTIONALITY for details. | |
| 93 FORCE_LTR_DIRECTIONALITY = 1 << 12, | |
| 94 | |
| 95 // Instructs DrawStringInt() to not use subpixel rendering. This is useful | 81 // Instructs DrawStringInt() to not use subpixel rendering. This is useful |
| 96 // when rendering text onto a fully- or partially-transparent background | 82 // when rendering text onto a fully- or partially-transparent background |
| 97 // that will later be blended with another image. | 83 // that will later be blended with another image. |
| 98 NO_SUBPIXEL_RENDERING = 1 << 13, | 84 NO_SUBPIXEL_RENDERING = 1 << 11, |
| 99 }; | 85 }; |
| 100 | 86 |
| 101 // Creates an empty canvas with scale factor of 1x. | 87 // Creates an empty canvas with scale factor of 1x. |
| 102 Canvas(); | 88 Canvas(); |
| 103 | 89 |
| 104 // Creates canvas with provided DIP |size| and a scale factor of 1x. | 90 // Creates canvas with provided DIP |size| and a scale factor of 1x. |
| 105 // If this canvas is not opaque, it's explicitly cleared to transparent before | 91 // If this canvas is not opaque, it's explicitly cleared to transparent before |
| 106 // being returned. | 92 // being returned. |
| 107 // TODO(pkotwicz): Remove this constructor. | 93 // TODO(pkotwicz): Remove this constructor. |
| 108 Canvas(const gfx::Size& size, bool is_opaque); | 94 Canvas(const gfx::Size& size, bool is_opaque); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 // An additional scale can be applied via Canvas::Scale(). However, | 420 // An additional scale can be applied via Canvas::Scale(). However, |
| 435 // Canvas::Scale() does not affect |scale_factor_|. | 421 // Canvas::Scale() does not affect |scale_factor_|. |
| 436 ui::ScaleFactor scale_factor_; | 422 ui::ScaleFactor scale_factor_; |
| 437 | 423 |
| 438 DISALLOW_COPY_AND_ASSIGN(Canvas); | 424 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 439 }; | 425 }; |
| 440 | 426 |
| 441 } // namespace gfx | 427 } // namespace gfx |
| 442 | 428 |
| 443 #endif // UI_GFX_CANVAS_H_ | 429 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |