Skip to content

Commit

Permalink
Add Path::offset/transform() with a dst parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed May 19, 2020
1 parent 8032d18 commit e45419f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gfx/path_none.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ namespace gfx {
Path& lineTo(float x, float y) { return *this; }
Path& lineTo(const Point& p) { return *this; }
Path& close() { return *this; }
void offset(float dx, float dy, Path* dst) const { }
void offset(float dx, float dy) { }
void transform(const Matrix& matrix, Path* dst) { }
void transform(const Matrix& matrix) { }
RectF bounds() const { return RectF(); }
};
Expand Down
8 changes: 8 additions & 0 deletions gfx/path_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ namespace gfx {
return *this;
}

void offset(float dx, float dy, Path* dst) const {
m_skPath.offset(dx, dy, &dst->m_skPath);
}

void offset(float dx, float dy) {
m_skPath.offset(dx, dy);
}

void transform(const Matrix& matrix, Path* dst) {
m_skPath.transform(matrix.skMatrix(), &dst->m_skPath);
}

void transform(const Matrix& matrix) {
m_skPath.transform(matrix.skMatrix());
}
Expand Down

0 comments on commit e45419f

Please sign in to comment.