| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 SkFloatToScalar(p2.x()), SkFloatToScalar(p2.y()), paint); | 280 SkFloatToScalar(p2.x()), SkFloatToScalar(p2.y()), paint); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void Canvas::DrawCircle(const Point& center_point, | 283 void Canvas::DrawCircle(const Point& center_point, |
| 284 int radius, | 284 int radius, |
| 285 const SkPaint& paint) { | 285 const SkPaint& paint) { |
| 286 canvas_->drawCircle(SkIntToScalar(center_point.x()), | 286 canvas_->drawCircle(SkIntToScalar(center_point.x()), |
| 287 SkIntToScalar(center_point.y()), SkIntToScalar(radius), paint); | 287 SkIntToScalar(center_point.y()), SkIntToScalar(radius), paint); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void Canvas::DrawCircle(const PointF& center_point, |
| 291 float radius, |
| 292 const SkPaint& paint) { |
| 293 canvas_->drawCircle(SkFloatToScalar(center_point.x()), |
| 294 SkFloatToScalar(center_point.y()), radius, paint); |
| 295 } |
| 296 |
| 290 void Canvas::DrawRoundRect(const Rect& rect, | 297 void Canvas::DrawRoundRect(const Rect& rect, |
| 291 int radius, | 298 int radius, |
| 292 const SkPaint& paint) { | 299 const SkPaint& paint) { |
| 293 canvas_->drawRoundRect(RectToSkRect(rect), SkIntToScalar(radius), | 300 canvas_->drawRoundRect(RectToSkRect(rect), SkIntToScalar(radius), |
| 294 SkIntToScalar(radius), paint); | 301 SkIntToScalar(radius), paint); |
| 295 } | 302 } |
| 296 | 303 |
| 297 void Canvas::DrawRoundRect(const RectF& rect, | 304 void Canvas::DrawRoundRect(const RectF& rect, |
| 298 float radius, | 305 float radius, |
| 299 const SkPaint& paint) { | 306 const SkPaint& paint) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); | 565 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); |
| 559 p.setShader(CreateImageRepShaderForScale( | 566 p.setShader(CreateImageRepShaderForScale( |
| 560 image_rep, SkShader::kRepeat_TileMode, shader_scale, | 567 image_rep, SkShader::kRepeat_TileMode, shader_scale, |
| 561 remove_image_scale ? image_rep.scale() : 1.f)); | 568 remove_image_scale ? image_rep.scale() : 1.f)); |
| 562 | 569 |
| 563 // The rect will be filled by the bitmap. | 570 // The rect will be filled by the bitmap. |
| 564 canvas_->drawRect(dest_rect, p); | 571 canvas_->drawRect(dest_rect, p); |
| 565 } | 572 } |
| 566 | 573 |
| 567 } // namespace gfx | 574 } // namespace gfx |
| OLD | NEW |