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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 NO_ELLIPSIS = 1 << 7, | 62 NO_ELLIPSIS = 1 << 7, |
63 | 63 |
64 // Specifies if words can be split by new lines. | 64 // Specifies if words can be split by new lines. |
65 // This only works with MULTI_LINE. | 65 // This only works with MULTI_LINE. |
66 CHARACTER_BREAK = 1 << 8, | 66 CHARACTER_BREAK = 1 << 8, |
67 | 67 |
68 // Instructs DrawStringRect() to not use subpixel rendering. This is useful | 68 // Instructs DrawStringRect() to not use subpixel rendering. This is useful |
69 // when rendering text onto a fully- or partially-transparent background | 69 // when rendering text onto a fully- or partially-transparent background |
70 // that will later be blended with another image. | 70 // that will later be blended with another image. |
71 NO_SUBPIXEL_RENDERING = 1 << 9, | 71 NO_SUBPIXEL_RENDERING = 1 << 9, |
72 | |
73 // Specifies the alignment for text rendered with the DrawStringRect method. | |
msw
2015/04/01 15:07:17
Let's not add these flags unless they are imminent
| |
74 TEXT_ALIGN_TOP = 1 << 10, | |
75 TEXT_ALIGN_MIDDLE = 1 << 11, | |
76 TEXT_ALIGN_BOTTOM = 1 << 12, | |
72 }; | 77 }; |
73 | 78 |
74 // Creates an empty canvas with image_scale of 1x. | 79 // Creates an empty canvas with image_scale of 1x. |
75 Canvas(); | 80 Canvas(); |
76 | 81 |
77 // Creates canvas with provided DIP |size| and |image_scale|. | 82 // Creates canvas with provided DIP |size| and |image_scale|. |
78 // If this canvas is not opaque, it's explicitly cleared to transparent before | 83 // If this canvas is not opaque, it's explicitly cleared to transparent before |
79 // being returned. | 84 // being returned. |
80 Canvas(const Size& size, float image_scale, bool is_opaque); | 85 Canvas(const Size& size, float image_scale, bool is_opaque); |
81 | 86 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 | 448 |
444 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 449 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
445 SkCanvas* canvas_; | 450 SkCanvas* canvas_; |
446 | 451 |
447 DISALLOW_COPY_AND_ASSIGN(Canvas); | 452 DISALLOW_COPY_AND_ASSIGN(Canvas); |
448 }; | 453 }; |
449 | 454 |
450 } // namespace gfx | 455 } // namespace gfx |
451 | 456 |
452 #endif // UI_GFX_CANVAS_H_ | 457 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |