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 #include "ui/gfx/canvas.h" | 5 #include "ui/gfx/canvas.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 456 } |
457 | 457 |
458 void Canvas::DrawStringRect(const base::string16& text, | 458 void Canvas::DrawStringRect(const base::string16& text, |
459 const FontList& font_list, | 459 const FontList& font_list, |
460 SkColor color, | 460 SkColor color, |
461 const Rect& display_rect) { | 461 const Rect& display_rect) { |
462 DrawStringRectWithFlags(text, font_list, color, display_rect, | 462 DrawStringRectWithFlags(text, font_list, color, display_rect, |
463 DefaultCanvasTextAlignment()); | 463 DefaultCanvasTextAlignment()); |
464 } | 464 } |
465 | 465 |
466 void Canvas::DrawStringRectWithFlags(const base::string16& text, | |
467 const FontList& font_list, | |
468 SkColor color, | |
469 const Rect& display_rect, | |
470 int flags) { | |
471 DrawStringRectWithShadows(text, font_list, color, display_rect, 0, flags, | |
472 ShadowValues()); | |
473 } | |
474 | |
475 void Canvas::TileImageInt(const ImageSkia& image, | 466 void Canvas::TileImageInt(const ImageSkia& image, |
476 int x, | 467 int x, |
477 int y, | 468 int y, |
478 int w, | 469 int w, |
479 int h) { | 470 int h) { |
480 TileImageInt(image, 0, 0, x, y, w, h); | 471 TileImageInt(image, 0, 0, x, y, w, h); |
481 } | 472 } |
482 | 473 |
483 void Canvas::TileImageInt(const ImageSkia& image, | 474 void Canvas::TileImageInt(const ImageSkia& image, |
484 int src_x, | 475 int src_x, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); | 579 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); |
589 p.setShader(CreateImageRepShaderForScale( | 580 p.setShader(CreateImageRepShaderForScale( |
590 image_rep, SkShader::kRepeat_TileMode, shader_scale, | 581 image_rep, SkShader::kRepeat_TileMode, shader_scale, |
591 remove_image_scale ? image_rep.scale() : 1.f)); | 582 remove_image_scale ? image_rep.scale() : 1.f)); |
592 | 583 |
593 // The rect will be filled by the bitmap. | 584 // The rect will be filled by the bitmap. |
594 canvas_->drawRect(dest_rect, p); | 585 canvas_->drawRect(dest_rect, p); |
595 } | 586 } |
596 | 587 |
597 } // namespace gfx | 588 } // namespace gfx |
OLD | NEW |