#include "SkDumpCanvas.h"
#ifdef SK_DEVELOPER
+#include "SkPatchUtils.h"
#include "SkPicture.h"
#include "SkPixelRef.h"
#include "SkRRect.h"
///////////////////////////////////////////////////////////////////////////////
-void SkDumpCanvas::willSave(SaveFlags flags) {
- this->dump(kSave_Verb, NULL, "save(0x%X)", flags);
- this->INHERITED::willSave(flags);
+void SkDumpCanvas::willSave() {
+ this->dump(kSave_Verb, NULL, "save()");
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkDumpCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
str.c_str(), byteLength);
}
-void SkDumpCanvas::onDrawPicture(const SkPicture* picture) {
+void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
+ const SkPaint* paint) {
this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture,
picture->width(), picture->height());
fNestLevel += 1;
- this->INHERITED::onDrawPicture(picture);
+ this->INHERITED::onDrawPicture(picture, matrix, paint);
fNestLevel -= 1;
this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture,
picture->width(), picture->height());
SkScalarToFloat(vertices[0].fY));
}
+void SkDumpCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
+ const SkPoint texCoords[4], SkXfermode* xmode,
+ const SkPaint& paint) {
+ //dumps corner points and colors in clockwise order starting on upper-left corner
+ this->dump(kDrawPatch_Verb, &paint, "drawPatch(Vertices{[%f, %f], [%f, %f], [%f, %f], [%f, %f]}\
+ | Colors{[0x%x], [0x%x], [0x%x], [0x%x]} | TexCoords{[%f,%f], [%f,%f], [%f,%f], \
+ [%f,%f]})",
+ cubics[SkPatchUtils::kTopP0_CubicCtrlPts].fX,
+ cubics[SkPatchUtils::kTopP0_CubicCtrlPts].fY,
+ cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fX,
+ cubics[SkPatchUtils::kTopP3_CubicCtrlPts].fY,
+ cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fX,
+ cubics[SkPatchUtils::kBottomP3_CubicCtrlPts].fY,
+ cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fX,
+ cubics[SkPatchUtils::kBottomP0_CubicCtrlPts].fY,
+ colors[0], colors[1], colors[2], colors[3],
+ texCoords[0].x(), texCoords[0].y(), texCoords[1].x(), texCoords[1].y(),
+ texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3].y());
+}
+
void SkDumpCanvas::drawData(const void* data, size_t length) {
// this->dump(kDrawData_Verb, NULL, "drawData(%d)", length);
this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length,