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

Side by Side Diff: printing/metafile_skia_wrapper.h

Issue 2518443002: Experimetal copy of https://codereview.chromium.org/2512783002/ (Closed)
Patch Set: '' Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PRINTING_METAFILE_SKIA_WRAPPER_H_ 5 #ifndef PRINTING_METAFILE_SKIA_WRAPPER_H_
6 #define PRINTING_METAFILE_SKIA_WRAPPER_H_ 6 #define PRINTING_METAFILE_SKIA_WRAPPER_H_
7 7
8 #include "printing/printing_export.h" 8 #include "printing/printing_export.h"
9 #include "third_party/skia/include/core/SkRefCnt.h" 9 #include "third_party/skia/include/core/SkRefCnt.h"
10 10
11 class SkCanvas; 11 class SkCanvas;
12 12
13 namespace printing { 13 namespace printing {
14 14
15 class PdfMetafileSkia; 15 class PdfMetafileSkia;
16 16
17 // A wrapper class with static methods to set and retrieve a PdfMetafileSkia 17 // A wrapper class with static methods to set and retrieve a PdfMetafileSkia
18 // on an SkCanvas. The ownership of the metafile is not affected and it 18 // on an SkCanvas. The ownership of the metafile is not affected and it
19 // is the caller's responsibility to ensure that the metafile remains valid 19 // is the caller's responsibility to ensure that the metafile remains valid
20 // as long as the canvas. 20 // as long as the canvas.
21 class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt { 21 class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt {
22 public: 22 public:
23 static void SetMetafileOnCanvas(const SkCanvas& canvas, 23 static void SetMetafileOnCanvas(const SkCanvas& canvas,
24 PdfMetafileSkia* metafile); 24 PdfMetafileSkia* metafile);
25 25
26 static PdfMetafileSkia* GetMetafileFromCanvas(const SkCanvas& canvas); 26 static sk_sp<MetafileSkiaWrapper> RefFromCanvas(const SkCanvas& canvas);
27
28 PdfMetafileSkia* metafile() const { return metafile_; }
27 29
28 private: 30 private:
29 explicit MetafileSkiaWrapper(PdfMetafileSkia* metafile); 31 explicit MetafileSkiaWrapper(PdfMetafileSkia* metafile);
30 32
31 PdfMetafileSkia* metafile_; 33 PdfMetafileSkia* metafile_;
32 }; 34 };
33 35
34 } // namespace printing 36 } // namespace printing
35 37
36 #endif // PRINTING_METAFILE_SKIA_WRAPPER_H_ 38 #endif // PRINTING_METAFILE_SKIA_WRAPPER_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | printing/metafile_skia_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698