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
diff --git a/tools/json/SkJSONCanvas.cpp b/tools/json/SkJSONCanvas.cpp
index efc4acd..2272f88 100644
--- a/tools/json/SkJSONCanvas.cpp
+++ b/tools/json/SkJSONCanvas.cpp
@@ -382,7 +382,16 @@
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 @@
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;
}