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
3 // found in the LICENSE file.
4 
5 #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_PATTERN_H_
6 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_IMAGE_PATTERN_H_
7 
8 #include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
9 #include "third_party/blink/renderer/platform/graphics/pattern.h"
10 
11 namespace blink {
12 
13 class Image;
14 
15 class PLATFORM_EXPORT ImagePattern final : public Pattern {
16  public:
17   static scoped_refptr<ImagePattern> Create(scoped_refptr<Image>, RepeatMode);
18 
19   bool IsTextureBacked() const override;
20 
21  protected:
22   sk_sp<PaintShader> CreateShader(const SkMatrix&) override;
23 
24  private:
25   ImagePattern(scoped_refptr<Image>, RepeatMode);
26 
27   PaintImage tile_image_;
28 };
29 
30 }  // namespace blink
31 
32 #endif /* ImagePattern_h */
33