| 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 | 10 |
| 11 class SkPicture; | 11 class SkPicture; |
| 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(PassRefPtr<SkPicture> picture,
const IntSize& size) | 17 static PassRefPtr<PaintGeneratedImage> create(PassRefPtr<SkPicture> picture,
const IntSize& size) |
| 18 { | 18 { |
| 19 return adoptRef(new PaintGeneratedImage(picture, size)); | 19 return adoptRef(new PaintGeneratedImage(picture, size)); |
| 20 } | 20 } |
| 21 ~PaintGeneratedImage() override { } | 21 ~PaintGeneratedImage() = default; |
| 22 |
| 23 bool hasRelativeSize() const override { return false; } |
| 22 | 24 |
| 23 protected: | 25 protected: |
| 24 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, Res
pectImageOrientationEnum, ImageClampingMode) override; | 26 void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, Res
pectImageOrientationEnum, ImageClampingMode) override; |
| 25 void drawTile(GraphicsContext&, const FloatRect&) final; | 27 void drawTile(GraphicsContext&, const FloatRect&) final; |
| 26 | 28 |
| 27 PaintGeneratedImage(PassRefPtr<SkPicture> picture, const IntSize& size) | 29 PaintGeneratedImage(PassRefPtr<SkPicture> picture, const IntSize& size) |
| 28 : GeneratedImage(size) | 30 : GeneratedImage(size) |
| 29 , m_picture(picture) | 31 , m_picture(picture) |
| 30 { | 32 { |
| 31 } | 33 } |
| 32 | 34 |
| 33 RefPtr<SkPicture> m_picture; | 35 RefPtr<SkPicture> m_picture; |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 } // namespace blink | 38 } // namespace blink |
| 37 | 39 |
| 38 #endif // PaintGeneratedImage_h | 40 #endif // PaintGeneratedImage_h |
| OLD | NEW |