| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 NO_ELLIPSIS = 1 << 7, | 66 NO_ELLIPSIS = 1 << 7, |
| 67 | 67 |
| 68 // Specifies if words can be split by new lines. | 68 // Specifies if words can be split by new lines. |
| 69 // This only works with MULTI_LINE. | 69 // This only works with MULTI_LINE. |
| 70 CHARACTER_BREAK = 1 << 8, | 70 CHARACTER_BREAK = 1 << 8, |
| 71 | 71 |
| 72 // Instructs DrawStringRect() to not use subpixel rendering. This is useful | 72 // Instructs DrawStringRect() to not use subpixel rendering. This is useful |
| 73 // when rendering text onto a fully- or partially-transparent background | 73 // when rendering text onto a fully- or partially-transparent background |
| 74 // that will later be blended with another image. | 74 // that will later be blended with another image. |
| 75 NO_SUBPIXEL_RENDERING = 1 << 9, | 75 NO_SUBPIXEL_RENDERING = 1 << 9, |
| 76 |
| 77 // Draw text with 1px border. |
| 78 HALO_EFFECT = 1 << 10, |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 // Creates an empty canvas with image_scale of 1x. | 81 // Creates an empty canvas with image_scale of 1x. |
| 79 Canvas(); | 82 Canvas(); |
| 80 | 83 |
| 81 // Creates canvas with provided DIP |size| and |image_scale|. | 84 // Creates canvas with provided DIP |size| and |image_scale|. |
| 82 // If this canvas is not opaque, it's explicitly cleared to transparent before | 85 // If this canvas is not opaque, it's explicitly cleared to transparent before |
| 83 // being returned. | 86 // being returned. |
| 84 Canvas(const Size& size, float image_scale, bool is_opaque); | 87 Canvas(const Size& size, float image_scale, bool is_opaque); |
| 85 | 88 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 float image_scale_; | 457 float image_scale_; |
| 455 | 458 |
| 456 sk_sp<SkCanvas> canvas_; | 459 sk_sp<SkCanvas> canvas_; |
| 457 | 460 |
| 458 DISALLOW_COPY_AND_ASSIGN(Canvas); | 461 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 459 }; | 462 }; |
| 460 | 463 |
| 461 } // namespace gfx | 464 } // namespace gfx |
| 462 | 465 |
| 463 #endif // UI_GFX_CANVAS_H_ | 466 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |