OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PaintArtifactToSkCanvas_h | 5 #ifndef PaintArtifactToSkCanvas_h |
6 #define PaintArtifactToSkCanvas_h | 6 #define PaintArtifactToSkCanvas_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "wtf/PassRefPtr.h" | 9 #include "third_party/skia/include/core/SkRefCnt.h" |
10 | 10 |
11 class SkCanvas; | 11 class SkCanvas; |
12 class SkPicture; | 12 class SkPicture; |
13 struct SkRect; | 13 struct SkRect; |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class PaintArtifact; | 17 class PaintArtifact; |
18 | 18 |
19 // Paints a paint artifact to an SkCanvas from the paint chunks and their | 19 // Paints a paint artifact to an SkCanvas from the paint chunks and their |
20 // associated properties, rather than from the transform (etc.) display items in | 20 // associated properties, rather than from the transform (etc.) display items in |
21 // the display item list. | 21 // the display item list. |
22 // | 22 // |
23 // This is limited to Skia commands, and so is not full-featured. In particular, | 23 // This is limited to Skia commands, and so is not full-featured. In particular, |
24 // Skia does not support 3D transforms, which require support from the | 24 // Skia does not support 3D transforms, which require support from the |
25 // compositor. | 25 // compositor. |
26 PLATFORM_EXPORT void paintArtifactToSkCanvas(const PaintArtifact&, SkCanvas*); | 26 PLATFORM_EXPORT void paintArtifactToSkCanvas(const PaintArtifact&, SkCanvas*); |
27 | 27 |
28 // Using the previous, converts the paint artifact to an SkPicture. | 28 // Using the previous, converts the paint artifact to an SkPicture. |
29 PLATFORM_EXPORT PassRefPtr<SkPicture> paintArtifactToSkPicture( | 29 PLATFORM_EXPORT sk_sp<const SkPicture> paintArtifactToSkPicture( |
30 const PaintArtifact&, const SkRect& bounds); | 30 const PaintArtifact&, const SkRect& bounds); |
31 | 31 |
32 } // namespace blink | 32 } // namespace blink |
33 | 33 |
34 #endif // PaintArtifactToSkCanvas_h | 34 #endif // PaintArtifactToSkCanvas_h |
OLD | NEW |