OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ | |
6 #define PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ | |
7 | |
8 #include "third_party/skia/include/core/SkRefCnt.h" | |
9 | |
10 class SkCanvas; | |
11 | |
12 namespace printing { | |
13 | |
14 class NativeMetafile; | |
15 | |
16 // A wrapper class with static methods to set and retrieve a NativeMetafile | |
17 // on an SkCanvas. The ownership of the metafile is not affected and it | |
18 // is the caller's responsibility to ensure that the metafile remains valid | |
19 // as long as the canvas. | |
20 class NativeMetafileSkiaWrapper : public SkRefCnt { | |
21 public: | |
22 static void SetMetafileOnCanvas(SkCanvas* canvas, NativeMetafile* metafile); | |
23 | |
24 static NativeMetafile* GetMetafileFromCanvas(SkCanvas* canvas); | |
25 | |
26 private: | |
27 NativeMetafile* metafile_; | |
28 | |
29 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.
| |
30 | |
31 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 ;-)
| |
32 }; | |
33 | |
34 } // namespace printing | |
35 | |
36 #endif // PRINTING_NATIVE_METAFILE_SKIA_WRAPPER_H_ | |
OLD | NEW |