return result;
}
-static Json::Value make_json_irect(const SkIRect& rect) {
+Json::Value SkDrawCommand::MakeJsonIRect(const SkIRect& rect) {
Json::Value result(Json::arrayValue);
result.append(Json::Value(rect.left()));
result.append(Json::Value(rect.top()));
return result;
}
-static Json::Value make_json_matrix(const SkMatrix& matrix) {
+Json::Value SkDrawCommand::MakeJsonMatrix(const SkMatrix& matrix) {
Json::Value result(Json::arrayValue);
Json::Value row1(Json::arrayValue);
row1.append(Json::Value(matrix[0]));
Json::Value SkConcatCommand::toJSON(UrlDataManager& urlDataManager) const {
Json::Value result = INHERITED::toJSON(urlDataManager);
- result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix);
+ result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix);
return result;
}
Json::Value encoded;
if (flatten(fBitmap, &encoded, urlDataManager)) {
result[SKDEBUGCANVAS_ATTRIBUTE_BITMAP] = encoded;
- result[SKDEBUGCANVAS_ATTRIBUTE_CENTER] = make_json_irect(fCenter);
+ result[SKDEBUGCANVAS_ATTRIBUTE_CENTER] = MakeJsonIRect(fCenter);
result[SKDEBUGCANVAS_ATTRIBUTE_DST] = make_json_rect(fDst);
if (fPaintPtr != nullptr) {
result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = make_json_paint(*fPaintPtr, urlDataManager);
Json::Value coords(Json::arrayValue);
result[SKDEBUGCANVAS_ATTRIBUTE_PATH] = make_json_path(fPath);
if (!fMatrix.isIdentity()) {
- result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix);
+ result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix);
}
result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = make_json_paint(fPaint, urlDataManager);
return result;
Json::Value SkSetMatrixCommand::toJSON(UrlDataManager& urlDataManager) const {
Json::Value result = INHERITED::toJSON(urlDataManager);
- result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = make_json_matrix(fMatrix);
+ result[SKDEBUGCANVAS_ATTRIBUTE_MATRIX] = MakeJsonMatrix(fMatrix);
return result;
}
#include "png.h"
-#include "SkJSONCanvas.h"
-
const int Request::kImageWidth = 1920;
const int Request::kImageHeight = 1080;
SkMatrix vm = fDebugCanvas->getCurrentMatrix();
SkIRect clip = fDebugCanvas->getCurrentClip();
Json::Value info(Json::objectValue);
- info["ViewMatrix"] = SkJSONCanvas::MakeMatrix(vm);
- info["ClipRect"] = SkJSONCanvas::MakeIRect(clip);
+ info["ViewMatrix"] = SkDrawCommand::MakeJsonMatrix(vm);
+ info["ClipRect"] = SkDrawCommand::MakeJsonIRect(clip);
std::string json = Json::FastWriter().write(info);