Skip to content

Commit

Permalink
Add flag in preparation for 4x4 matrices in SkCanvas
Browse files Browse the repository at this point in the history
Part of the transition is for getTotalMatrix() to return by value.

Related Skia CL: https://skia-review.googlesource.com/c/skia/+/262056

Change-Id: I7fd9e303b6078911bf82b3c43d2092e6131821c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1987192
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728926}
  • Loading branch information
reed-at-google authored and Commit Bot committed Jan 7, 2020
1 parent b7df28d commit f97e2d1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cc/paint/paint_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class CC_PAINT_EXPORT PaintCanvas {
virtual void drawPicture(sk_sp<const PaintRecord> record) = 0;

virtual bool isClipEmpty() const = 0;
virtual const SkMatrix& getTotalMatrix() const = 0;
virtual SkMatrix getTotalMatrix() const = 0;

// Used for printing
enum class AnnotationType {
Expand Down
2 changes: 1 addition & 1 deletion cc/paint/record_paint_canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ bool RecordPaintCanvas::isClipEmpty() const {
return GetCanvas()->isClipEmpty();
}

const SkMatrix& RecordPaintCanvas::getTotalMatrix() const {
SkMatrix RecordPaintCanvas::getTotalMatrix() const {
return GetCanvas()->getTotalMatrix();
}

Expand Down
2 changes: 1 addition & 1 deletion cc/paint/record_paint_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CC_PAINT_EXPORT RecordPaintCanvas : public PaintCanvas {
void drawPicture(sk_sp<const PaintRecord> record) override;

bool isClipEmpty() const override;
const SkMatrix& getTotalMatrix() const override;
SkMatrix getTotalMatrix() const override;

void Annotate(AnnotationType type,
const SkRect& rect,
Expand Down
2 changes: 1 addition & 1 deletion cc/paint/skia_paint_canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ bool SkiaPaintCanvas::isClipEmpty() const {
return canvas_->isClipEmpty();
}

const SkMatrix& SkiaPaintCanvas::getTotalMatrix() const {
SkMatrix SkiaPaintCanvas::getTotalMatrix() const {
return canvas_->getTotalMatrix();
}

Expand Down
2 changes: 1 addition & 1 deletion cc/paint/skia_paint_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class CC_PAINT_EXPORT SkiaPaintCanvas final : public PaintCanvas {
void drawPicture(sk_sp<const PaintRecord> record) override;

bool isClipEmpty() const override;
const SkMatrix& getTotalMatrix() const override;
SkMatrix getTotalMatrix() const override;

void Annotate(AnnotationType type,
const SkRect& rect,
Expand Down
4 changes: 4 additions & 0 deletions skia/config/SkUserConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ SK_API void SkDebugf_FileLine(const char* file,
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING
#endif

#ifndef SK_SUPPORT_LEGACY_CANVAS_MATRIX_33
#define SK_SUPPORT_LEGACY_CANVAS_MATRIX_33
#endif

#ifndef SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS
#define SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class MockPaintCanvas : public cc::PaintCanvas {
MOCK_METHOD1(drawPicture, void(sk_sp<const PaintRecord> record));
MOCK_CONST_METHOD0(isClipEmpty, bool());
MOCK_CONST_METHOD0(isClipRect, bool());
MOCK_CONST_METHOD0(getTotalMatrix, const SkMatrix&());
MOCK_CONST_METHOD0(getTotalMatrix, SkMatrix());

MOCK_METHOD3(Annotate,
void(AnnotationType type,
Expand Down

0 comments on commit f97e2d1

Please sign in to comment.