Index: printing/native_metafile_skia_wrapper.h |
diff --git a/printing/native_metafile_skia_wrapper.h b/printing/native_metafile_skia_wrapper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2134d655e897c5717ae6d44fbaeaf0591d040e74 |
--- /dev/null |
+++ b/printing/native_metafile_skia_wrapper.h |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ |
+#define PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ |
+ |
+#include "third_party/skia/include/core/SkRefCnt.h" |
+ |
+class SkCanvas; |
+ |
+namespace printing { |
+ |
+class NativeMetafile; |
+ |
+// A wrapper class with static methods to set and retrieve a NativeMetafile |
+// on an SkCanvas. The ownership of the metafile is not affected and it |
+// is the caller's responsibility to ensure that the metafile remains valid |
+// as long as the canvas. |
+class NativeMetafileSkiaWrapper : public SkRefCnt { |
+ public: |
+ static void SetMetafileOnCanvas(SkCanvas* canvas, NativeMetafile* metafile); |
+ |
+ static NativeMetafile* GetMetafileFromCanvas(SkCanvas* canvas); |
+ |
+ private: |
+ NativeMetafile* metafile_; |
+ |
+ static const char* kNativeMetafileKey; |
Lei Zhang
2011/03/24 21:28:27
Can't you just remove it here and instead put it i
vandebo (ex-Chrome)
2011/03/24 21:44:45
Done.
|
+ |
+ explicit NativeMetafileSkiaWrapper(NativeMetafile* metafile); |
Lei Zhang
2011/03/24 21:28:27
nit: this goes before the member variables.
vandebo (ex-Chrome)
2011/03/24 21:44:45
Done. (Skia does it in the other order ;-)
|
+}; |
+ |
+} // namespace printing |
+ |
+#endif // PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ |