OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ImagePattern_h | 5 #ifndef ImagePattern_h |
6 #define ImagePattern_h | 6 #define ImagePattern_h |
7 | 7 |
8 #include "platform/graphics/Pattern.h" | 8 #include "platform/graphics/Pattern.h" |
9 | 9 |
10 class SkImage; | 10 class SkImage; |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class Image; | 14 class Image; |
15 | 15 |
16 class PLATFORM_EXPORT ImagePattern final : public Pattern { | 16 class PLATFORM_EXPORT ImagePattern final : public Pattern { |
17 public: | 17 public: |
18 static PassRefPtr<ImagePattern> Create(PassRefPtr<Image>, RepeatMode); | 18 static PassRefPtr<ImagePattern> Create(PassRefPtr<Image>, RepeatMode); |
19 | 19 |
20 bool IsTextureBacked() const override; | 20 bool IsTextureBacked() const override; |
21 | 21 |
22 protected: | 22 protected: |
23 sk_sp<PaintShader> CreateShader(const SkMatrix&) override; | 23 std::unique_ptr<PaintShader> CreateShader(const SkMatrix&) override; |
24 bool IsLocalMatrixChanged(const SkMatrix&) const override; | 24 bool IsLocalMatrixChanged(const SkMatrix&) const override; |
25 | 25 |
26 private: | 26 private: |
27 ImagePattern(PassRefPtr<Image>, RepeatMode); | 27 ImagePattern(PassRefPtr<Image>, RepeatMode); |
28 SkMatrix previous_local_matrix_; | 28 SkMatrix previous_local_matrix_; |
29 | 29 |
30 sk_sp<SkImage> tile_image_; | 30 sk_sp<SkImage> tile_image_; |
31 }; | 31 }; |
32 | 32 |
33 } // namespace blink | 33 } // namespace blink |
34 | 34 |
35 #endif /* ImagePattern_h */ | 35 #endif /* ImagePattern_h */ |
OLD | NEW |