| 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 <memory> | 10 #include <memory> |
| (...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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 float image_scale_; | 453 float image_scale_; |
| 451 | 454 |
| 452 sk_sp<SkCanvas> canvas_; | 455 sk_sp<SkCanvas> canvas_; |
| 453 | 456 |
| 454 DISALLOW_COPY_AND_ASSIGN(Canvas); | 457 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 455 }; | 458 }; |
| 456 | 459 |
| 457 } // namespace gfx | 460 } // namespace gfx |
| 458 | 461 |
| 459 #endif // UI_GFX_CANVAS_H_ | 462 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |