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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 NO_ELLIPSIS = 1 << 7, | 65 NO_ELLIPSIS = 1 << 7, |
66 | 66 |
67 // Specifies if words can be split by new lines. | 67 // Specifies if words can be split by new lines. |
68 // This only works with MULTI_LINE. | 68 // This only works with MULTI_LINE. |
69 CHARACTER_BREAK = 1 << 8, | 69 CHARACTER_BREAK = 1 << 8, |
70 | 70 |
71 // Instructs DrawStringRect() to not use subpixel rendering. This is useful | 71 // Instructs DrawStringRect() to not use subpixel rendering. This is useful |
72 // when rendering text onto a fully- or partially-transparent background | 72 // when rendering text onto a fully- or partially-transparent background |
73 // that will later be blended with another image. | 73 // that will later be blended with another image. |
74 NO_SUBPIXEL_RENDERING = 1 << 9, | 74 NO_SUBPIXEL_RENDERING = 1 << 9, |
| 75 |
| 76 // Draw text with 1px border. |
| 77 HALO_EFFECT = 1 << 10, |
75 }; | 78 }; |
76 | 79 |
77 // Creates an empty canvas with image_scale of 1x. | 80 // Creates an empty canvas with image_scale of 1x. |
78 Canvas(); | 81 Canvas(); |
79 | 82 |
80 // Creates canvas with provided DIP |size| and |image_scale|. | 83 // Creates canvas with provided DIP |size| and |image_scale|. |
81 // If this canvas is not opaque, it's explicitly cleared to transparent before | 84 // If this canvas is not opaque, it's explicitly cleared to transparent before |
82 // being returned. | 85 // being returned. |
83 Canvas(const Size& size, float image_scale, bool is_opaque); | 86 Canvas(const Size& size, float image_scale, bool is_opaque); |
84 | 87 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 444 |
442 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 445 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
443 SkCanvas* canvas_; | 446 SkCanvas* canvas_; |
444 | 447 |
445 DISALLOW_COPY_AND_ASSIGN(Canvas); | 448 DISALLOW_COPY_AND_ASSIGN(Canvas); |
446 }; | 449 }; |
447 | 450 |
448 } // namespace gfx | 451 } // namespace gfx |
449 | 452 |
450 #endif // UI_GFX_CANVAS_H_ | 453 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |