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

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

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/core.gni ('k') | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Canvas.h
diff --git a/sky/engine/core/painting/Canvas.h b/sky/engine/core/painting/Canvas.h
index 9f3e7670d61f359c6b368800cfa11c3b794a7a0c..7fb70b5cf33ba90a6c72ed5a714d549cae9c79cb 100644
--- a/sky/engine/core/painting/Canvas.h
+++ b/sky/engine/core/painting/Canvas.h
@@ -7,11 +7,14 @@
#include "sky/engine/bindings/exception_state.h"
#include "sky/engine/core/painting/CanvasPath.h"
+#include "sky/engine/core/painting/Offset.h"
#include "sky/engine/core/painting/Paint.h"
#include "sky/engine/core/painting/Picture.h"
#include "sky/engine/core/painting/PictureRecorder.h"
+#include "sky/engine/core/painting/Point.h"
#include "sky/engine/core/painting/RRect.h"
#include "sky/engine/core/painting/Rect.h"
+#include "sky/engine/core/painting/Size.h"
#include "sky/engine/platform/graphics/DisplayList.h"
#include "sky/engine/tonic/dart_wrappable.h"
#include "sky/engine/tonic/float32_list.h"
@@ -31,8 +34,7 @@ public:
}
static PassRefPtr<Canvas> create(PictureRecorder* recorder,
- double width,
- double height,
+ Size& bounds,
ExceptionState& es) {
ASSERT(recorder);
if (recorder->isRecording()) {
@@ -48,7 +50,7 @@ public:
// but it won't crash.
}
PassRefPtr<Canvas> canvas = create(
- recorder->beginRecording(width, height));
+ recorder->beginRecording(bounds.sk_size.width(), bounds.sk_size.height()));
recorder->set_canvas(canvas.get());
return canvas;
}
@@ -69,18 +71,15 @@ public:
void clipRRect(const RRect* rrect);
void clipPath(const CanvasPath* path);
- void drawLine(float x0, float y0, float x1, float y1, const Paint* paint);
+ void drawLine(const Point& p1, const Point& p2, const Paint* paint);
void drawPicture(Picture* picture);
void drawPaint(const Paint* paint);
void drawRect(const Rect& rect, const Paint* paint);
void drawRRect(const RRect* rrect, const Paint* paint);
void drawOval(const Rect& rect, const Paint* paint);
- void drawCircle(float x, float y, float radius, const Paint* paint);
+ void drawCircle(const Point& c, float radius, const Paint* paint);
void drawPath(const CanvasPath* path, const Paint* paint);
- void drawImage(const CanvasImage* image,
- float x,
- float y,
- const Paint* paint);
+ void drawImage(const CanvasImage* image, const Point& p, const Paint* paint);
void drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint* paint);
SkCanvas* skCanvas() { return m_canvas; }
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698