Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1342)

Unified Diff: sky/engine/core/painting/Canvas.cpp

Issue 1214833004: Split Size into Size and Offset. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/painting/Canvas.h ('k') | sky/engine/core/painting/Canvas.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Canvas.cpp
diff --git a/sky/engine/core/painting/Canvas.cpp b/sky/engine/core/painting/Canvas.cpp
index 7adfdd80774fa2e157a13f113a76f3703c06ab71..0e0bac9485372e17d4e95df09c190b9659cfd615 100644
--- a/sky/engine/core/painting/Canvas.cpp
+++ b/sky/engine/core/painting/Canvas.cpp
@@ -119,12 +119,12 @@ void Canvas::clipPath(const CanvasPath* path)
m_canvas->clipPath(path->path());
}
-void Canvas::drawLine(float x0, float y0, float x1, float y1, const Paint* paint)
+void Canvas::drawLine(const Point& p1, const Point& p2, const Paint* paint)
{
if (!m_canvas)
return;
ASSERT(paint);
- m_canvas->drawLine(x0, y0, x1, y1, paint->paint());
+ m_canvas->drawLine(p1.sk_point.x(), p1.sk_point.y(), p2.sk_point.x(), p2.sk_point.y(), paint->paint());
}
void Canvas::drawPicture(Picture* picture)
@@ -168,12 +168,12 @@ void Canvas::drawOval(const Rect& rect, const Paint* paint)
m_canvas->drawOval(rect.sk_rect, paint->paint());
}
-void Canvas::drawCircle(float x, float y, float radius, const Paint* paint)
+void Canvas::drawCircle(const Point& c, float radius, const Paint* paint)
{
if (!m_canvas)
return;
ASSERT(paint);
- m_canvas->drawCircle(x, y, radius, paint->paint());
+ m_canvas->drawCircle(c.sk_point.x(), c.sk_point.y(), radius, paint->paint());
}
void Canvas::drawPath(const CanvasPath* path, const Paint* paint)
@@ -185,14 +185,11 @@ void Canvas::drawPath(const CanvasPath* path, const Paint* paint)
m_canvas->drawPath(path->path(), paint->paint());
}
-void Canvas::drawImage(const CanvasImage* image,
- float x,
- float y,
- const Paint* paint) {
+void Canvas::drawImage(const CanvasImage* image, const Point& p, const Paint* paint) {
if (!m_canvas)
return;
ASSERT(image);
- m_canvas->drawBitmap(image->bitmap(), x, y, &paint->paint());
+ m_canvas->drawBitmap(image->bitmap(), p.sk_point.x(), p.sk_point.y(), &paint->paint());
}
void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint* paint) {
« no previous file with comments | « sky/engine/core/painting/Canvas.h ('k') | sky/engine/core/painting/Canvas.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698