diff options
author | 2016-02-04 06:08:33 -0800 | |
---|---|---|
committer | 2016-02-04 06:08:33 -0800 | |
commit | 29e5a8932d7dae782f2e58d312a038f8888dab30 (patch) | |
tree | badc6423cefb9df2da87c1a2a44e02db53ce0744 /tools/json/SkJSONCanvas.cpp | |
parent | a3d99a515bb379b60c38189de435b47bdc8dd528 (diff) |
Modify skia serve to return clip rect and view matrix
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1662003002
Review URL: https://codereview.chromium.org/1662003002
Diffstat (limited to 'tools/json/SkJSONCanvas.cpp')
-rw-r--r-- | tools/json/SkJSONCanvas.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/json/SkJSONCanvas.cpp b/tools/json/SkJSONCanvas.cpp index efc4acd1a3..2272f88152 100644 --- a/tools/json/SkJSONCanvas.cpp +++ b/tools/json/SkJSONCanvas.cpp @@ -382,7 +382,16 @@ Json::Value SkJSONCanvas::makePaint(const SkPaint& paint) { return result; } -Json::Value SkJSONCanvas::makeMatrix(const SkMatrix& matrix) { +Json::Value SkJSONCanvas::MakeIRect(const SkIRect& rect) { + Json::Value result(Json::arrayValue); + result.append(Json::Value(rect.left())); + result.append(Json::Value(rect.top())); + result.append(Json::Value(rect.right())); + result.append(Json::Value(rect.bottom())); + return result; +} + +Json::Value SkJSONCanvas::MakeMatrix(const SkMatrix& matrix) { Json::Value result(Json::arrayValue); Json::Value row1(Json::arrayValue); row1.append(Json::Value(matrix[0])); @@ -441,7 +450,7 @@ void SkJSONCanvas::updateMatrix() { if (matrix != fLastMatrix) { Json::Value command(Json::objectValue); command[SKJSONCANVAS_COMMAND] = Json::Value(SKJSONCANVAS_COMMAND_MATRIX); - command[SKJSONCANVAS_ATTRIBUTE_MATRIX] = this->makeMatrix(matrix); + command[SKJSONCANVAS_ATTRIBUTE_MATRIX] = MakeMatrix(matrix); fCommands.append(command); fLastMatrix = matrix; } |