| 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 "platform/graphics/paint/PaintRecord.h" |
| 11 #include "third_party/skia/include/core/SkRefCnt.h" | 11 #include "third_party/skia/include/core/SkRefCnt.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage { | 15 class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage { |
| 16 public: | 16 public: |
| 17 static PassRefPtr<PaintGeneratedImage> create(sk_sp<PaintRecord> record, | 17 static PassRefPtr<PaintGeneratedImage> create(sk_sp<PaintRecord> record, |
| 18 const IntSize& size) { | 18 const IntSize& size) { |
| 19 return adoptRef(new PaintGeneratedImage(std::move(record), size)); | 19 return adoptRef(new PaintGeneratedImage(std::move(record), size)); |
| 20 } | 20 } |
| 21 ~PaintGeneratedImage() override {} | 21 ~PaintGeneratedImage() override {} |
| 22 | 22 |
| 23 protected: | 23 protected: |
| 24 void draw(PaintCanvas*, | 24 void draw(PaintCanvas*, |
| 25 const PaintFlags&, | 25 const PaintFlags&, |
| 26 const FloatRect&, | 26 const FloatRect&, |
| 27 const FloatRect&, | 27 const FloatRect&, |
| 28 RespectImageOrientationEnum, | 28 RespectImageOrientationEnum, |
| 29 ImageClampingMode, | 29 ImageClampingMode) override; |
| 30 const ColorBehavior&) override; | |
| 31 void drawTile(GraphicsContext&, const FloatRect&) final; | 30 void drawTile(GraphicsContext&, const FloatRect&) final; |
| 32 | 31 |
| 33 PaintGeneratedImage(sk_sp<PaintRecord> record, const IntSize& size) | 32 PaintGeneratedImage(sk_sp<PaintRecord> record, const IntSize& size) |
| 34 : GeneratedImage(size), m_record(std::move(record)) {} | 33 : GeneratedImage(size), m_record(std::move(record)) {} |
| 35 | 34 |
| 36 sk_sp<PaintRecord> m_record; | 35 sk_sp<PaintRecord> m_record; |
| 37 }; | 36 }; |
| 38 | 37 |
| 39 } // namespace blink | 38 } // namespace blink |
| 40 | 39 |
| 41 #endif // PaintGeneratedImage_h | 40 #endif // PaintGeneratedImage_h |
| OLD | NEW |