Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1443)

Unified Diff: cc/paint/paint_canvas.cc

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Fix missing build_config include Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_canvas.cc
diff --git a/cc/paint/paint_canvas.cc b/cc/paint/paint_canvas.cc
index 042af4754fe0cad7132dcd9f18190bb5f5bf4514..53dab8fb45b7afb25ce32b72bb3915e02cf6df39 100644
--- a/cc/paint/paint_canvas.cc
+++ b/cc/paint/paint_canvas.cc
@@ -4,6 +4,14 @@
#include "cc/paint/paint_canvas.h"
+#include "third_party/skia/include/core/SkMetaData.h"
+
+#if defined(OS_MACOSX)
+namespace {
+const char kIsPreviewMetafileKey[] = "CrIsPreviewMetafile";
+}
+#endif
+
namespace cc {
PaintCanvasPassThrough::PaintCanvasPassThrough(SkCanvas* canvas)
@@ -34,4 +42,19 @@ bool ToPixmap(PaintCanvas* canvas, SkPixmap* output) {
return true;
}
+#if defined(OS_MACOSX)
+void SetIsPreviewMetafile(PaintCanvas* canvas, bool is_preview) {
+ SkMetaData& meta = canvas->getMetaData();
+ meta.setBool(kIsPreviewMetafileKey, is_preview);
+}
+
+bool IsPreviewMetafile(PaintCanvas* canvas) {
+ bool value;
+ SkMetaData& meta = canvas->getMetaData();
+ if (!meta.findBool(kIsPreviewMetafileKey, &value))
+ value = false;
+ return value;
+}
+#endif
+
} // namespace cc
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698