OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 Metafile; | 15 class Metafile; |
16 | 16 |
17 // A wrapper class with static methods to set and retrieve a Metafile | 17 // A wrapper class with static methods to set and retrieve a Metafile |
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(SkCanvas* canvas, Metafile* metafile); | 23 static void SetMetafileOnCanvas(const SkCanvas* canvas, Metafile* metafile); |
vandebo (ex-Chrome)
2011/09/27 16:49:00
const ref or pointer
kmadhusu
2011/09/27 18:15:01
Done.
| |
24 | 24 |
25 static Metafile* GetMetafileFromCanvas(SkCanvas* canvas); | 25 static Metafile* GetMetafileFromCanvas(const SkCanvas* canvas); |
26 | |
27 static void SetDraftMode(SkCanvas* canvas, bool draft_mode); | |
28 | |
29 static bool GetDraftMode(SkCanvas* canvas); | |
30 | 26 |
31 private: | 27 private: |
32 explicit MetafileSkiaWrapper(Metafile* metafile); | 28 explicit MetafileSkiaWrapper(Metafile* metafile); |
33 | 29 |
34 Metafile* metafile_; | 30 Metafile* metafile_; |
35 }; | 31 }; |
36 | 32 |
37 } // namespace printing | 33 } // namespace printing |
38 | 34 |
39 #endif // PRINTING_METAFILE_SKIA_WRAPPER_H_ | 35 #endif // PRINTING_METAFILE_SKIA_WRAPPER_H_ |
OLD | NEW |