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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Apply transformation on the canvas. | 414 // Apply transformation on the canvas. |
415 void Transform(const Transform& transform); | 415 void Transform(const Transform& transform); |
416 | 416 |
417 // Draws the given string with a fade gradient at the end. | 417 // Draws the given string with a fade gradient at the end. |
418 void DrawFadedString(const base::string16& text, | 418 void DrawFadedString(const base::string16& text, |
419 const FontList& font_list, | 419 const FontList& font_list, |
420 SkColor color, | 420 SkColor color, |
421 const Rect& display_rect, | 421 const Rect& display_rect, |
422 int flags); | 422 int flags); |
423 | 423 |
424 skia::PlatformCanvas* platform_canvas() const { return owned_canvas_.get(); } | 424 skia::PlatformCanvas* platform_canvas() { return owned_canvas_.get(); } |
425 SkCanvas* sk_canvas() const { return canvas_; } | 425 SkCanvas* sk_canvas() { return canvas_; } |
426 float image_scale() const { return image_scale_; } | 426 float image_scale() const { return image_scale_; } |
427 | 427 |
428 private: | 428 private: |
429 Canvas(SkCanvas* canvas, float image_scale); | 429 Canvas(SkCanvas* canvas, float image_scale); |
430 | 430 |
431 // Test whether the provided rectangle intersects the current clip rect. | 431 // Test whether the provided rectangle intersects the current clip rect. |
432 bool IntersectsClipRectInt(int x, int y, int w, int h); | 432 bool IntersectsClipRectInt(int x, int y, int w, int h); |
433 bool IntersectsClipRect(const Rect& rect); | 433 bool IntersectsClipRect(const Rect& rect); |
434 | 434 |
435 // Helper for the DrawImageInt functions declared above. The |pixel| | 435 // Helper for the DrawImageInt functions declared above. The |pixel| |
(...skipping 20 matching lines...) Expand all Loading... |
456 | 456 |
457 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 457 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
458 SkCanvas* canvas_; | 458 SkCanvas* canvas_; |
459 | 459 |
460 DISALLOW_COPY_AND_ASSIGN(Canvas); | 460 DISALLOW_COPY_AND_ASSIGN(Canvas); |
461 }; | 461 }; |
462 | 462 |
463 } // namespace gfx | 463 } // namespace gfx |
464 | 464 |
465 #endif // UI_GFX_CANVAS_H_ | 465 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |