| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaintGeneratedImage_h | 5 #ifndef PaintGeneratedImage_h |
| 6 #define PaintGeneratedImage_h | 6 #define PaintGeneratedImage_h |
| 7 | 7 |
| 8 #include "platform/geometry/IntSize.h" | 8 #include "platform/geometry/IntSize.h" |
| 9 #include "platform/graphics/GeneratedImage.h" | 9 #include "platform/graphics/GeneratedImage.h" |
| 10 #include "platform/graphics/paint/PaintRecord.h" |
| 10 #include "third_party/skia/include/core/SkRefCnt.h" | 11 #include "third_party/skia/include/core/SkRefCnt.h" |
| 11 | 12 |
| 12 class SkPicture; | |
| 13 | |
| 14 namespace blink { | 13 namespace blink { |
| 15 | 14 |
| 16 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage { | 15 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage { |
| 17 public: | 16 public: |
| 18 static PassRefPtr<PaintGeneratedImage> create(sk_sp<SkPicture> picture, | 17 static PassRefPtr<PaintGeneratedImage> create(sk_sp<PaintRecord> picture, |
| 19 const IntSize& size) { | 18 const IntSize& size) { |
| 20 return adoptRef(new PaintGeneratedImage(std::move(picture), size)); | 19 return adoptRef(new PaintGeneratedImage(std::move(picture), size)); |
| 21 } | 20 } |
| 22 ~PaintGeneratedImage() override {} | 21 ~PaintGeneratedImage() override {} |
| 23 | 22 |
| 24 protected: | 23 protected: |
| 25 void draw(SkCanvas*, | 24 void draw(PaintCanvas*, |
| 26 const SkPaint&, | 25 const PaintFlags&, |
| 27 const FloatRect&, | 26 const FloatRect&, |
| 28 const FloatRect&, | 27 const FloatRect&, |
| 29 RespectImageOrientationEnum, | 28 RespectImageOrientationEnum, |
| 30 ImageClampingMode, | 29 ImageClampingMode, |
| 31 const ColorBehavior&) override; | 30 const ColorBehavior&) override; |
| 32 void drawTile(GraphicsContext&, const FloatRect&) final; | 31 void drawTile(GraphicsContext&, const FloatRect&) final; |
| 33 | 32 |
| 34 PaintGeneratedImage(sk_sp<SkPicture> picture, const IntSize& size) | 33 PaintGeneratedImage(sk_sp<PaintRecord> picture, const IntSize& size) |
| 35 : GeneratedImage(size), m_picture(std::move(picture)) {} | 34 : GeneratedImage(size), m_picture(std::move(picture)) {} |
| 36 | 35 |
| 37 sk_sp<SkPicture> m_picture; | 36 sk_sp<PaintRecord> m_picture; |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 } // namespace blink | 39 } // namespace blink |
| 41 | 40 |
| 42 #endif // PaintGeneratedImage_h | 41 #endif // PaintGeneratedImage_h |
| OLD | NEW |