| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // Apply transformation on the canvas. | 464 // Apply transformation on the canvas. |
| 465 void Transform(const Transform& transform); | 465 void Transform(const Transform& transform); |
| 466 | 466 |
| 467 // Draws the given string with a fade gradient at the end. | 467 // Draws the given string with a fade gradient at the end. |
| 468 void DrawFadedString(const base::string16& text, | 468 void DrawFadedString(const base::string16& text, |
| 469 const FontList& font_list, | 469 const FontList& font_list, |
| 470 SkColor color, | 470 SkColor color, |
| 471 const Rect& display_rect, | 471 const Rect& display_rect, |
| 472 int flags); | 472 int flags); |
| 473 | 473 |
| 474 SkBitmap ToBitmap(); |
| 475 |
| 474 // TODO(enne): rename sk_canvas members and interface. | 476 // TODO(enne): rename sk_canvas members and interface. |
| 475 cc::PaintCanvas* sk_canvas() { return canvas_; } | 477 cc::PaintCanvas* sk_canvas() { return canvas_; } |
| 476 float image_scale() const { return image_scale_; } | 478 float image_scale() const { return image_scale_; } |
| 477 | 479 |
| 478 private: | 480 private: |
| 479 // Tests whether the provided rectangle intersects the current clip rect. | 481 // Tests whether the provided rectangle intersects the current clip rect. |
| 480 bool IntersectsClipRect(const SkRect& rect); | 482 bool IntersectsClipRect(const SkRect& rect); |
| 481 | 483 |
| 482 // Helper for the DrawImageInt functions declared above. The | 484 // Helper for the DrawImageInt functions declared above. The |
| 483 // |remove_image_scale| parameter indicates if the scale of the |image_rep| | 485 // |remove_image_scale| parameter indicates if the scale of the |image_rep| |
| (...skipping 22 matching lines...) Expand all Loading... |
| 506 // but surface_ will be null. | 508 // but surface_ will be null. |
| 507 sk_sp<cc::PaintSurface> surface_; | 509 sk_sp<cc::PaintSurface> surface_; |
| 508 cc::PaintCanvas* canvas_; | 510 cc::PaintCanvas* canvas_; |
| 509 | 511 |
| 510 DISALLOW_COPY_AND_ASSIGN(Canvas); | 512 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 511 }; | 513 }; |
| 512 | 514 |
| 513 } // namespace gfx | 515 } // namespace gfx |
| 514 | 516 |
| 515 #endif // UI_GFX_CANVAS_H_ | 517 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |