aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-03 08:13:54 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-03 08:13:54 -0800
commit0eda2587cc9233066cb3f3fec08f35c061780f8e (patch)
treed48efc9eaa40406d0dc8e8b7931629b049ad1909 /src/utils
parentc6663dc36b157e40c8225130f5970a346f9ba7c3 (diff)
move annotations to canvas virtual
In an effort to do it all at once, this change assumes that its ok to ignore annotations that were previously stored on paints in old SKP files (since this feature is only interesting to PDF printing). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1744103002 Review URL: https://codereview.chromium.org/1744103002
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkDumpCanvas.cpp8
-rw-r--r--src/utils/SkNWayCanvas.cpp7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 916c32a655..75fa836a6a 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -9,6 +9,7 @@
#include "SkDumpCanvas.h"
#ifdef SK_DEVELOPER
+#include "SkData.h"
#include "SkPatchUtils.h"
#include "SkPicture.h"
#include "SkPixelRef.h"
@@ -482,6 +483,13 @@ void SkDumpCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3].y());
}
+void SkDumpCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* value) {
+ SkString str;
+ toString(rect, &str);
+ this->dump(kDrawAnnotation_Verb, nullptr, "drawAnnotation(%s \"%s\" (%zu))",
+ str.c_str(), key, value ? value->size() : 0);
+}
+
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index e3b1e019b6..fd5fa82aa5 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -292,6 +292,13 @@ void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
}
}
+void SkNWayCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* data) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawAnnotation(rect, key, data);
+ }
+}
+
#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
SkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) {
Iter iter(fList);