1// Copyright 2013 The Flutter 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 FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
6#define FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
7
8#include "flutter/lib/ui/dart_wrapper.h"
9#include "flutter/lib/ui/painting/gradient.h"
10#include "flutter/lib/ui/painting/image.h"
11#include "flutter/lib/ui/painting/matrix.h"
12#include "flutter/lib/ui/painting/shader.h"
13#include "third_party/skia/include/core/SkMatrix.h"
14#include "third_party/skia/include/core/SkShader.h"
15#include "third_party/tonic/typed_data/typed_list.h"
16
17namespace tonic {
18class DartLibraryNatives;
19} // namespace tonic
20
21namespace flutter {
22
23class ImageShader : public Shader {
24 DEFINE_WRAPPERTYPEINFO();
25 FML_FRIEND_MAKE_REF_COUNTED(ImageShader);
26
27 public:
28 ~ImageShader() override;
29 static fml::RefPtr<ImageShader> Create();
30
31 void initWithImage(CanvasImage* image,
32 SkTileMode tmx,
33 SkTileMode tmy,
34 const tonic::Float64List& matrix4);
35
36 static void RegisterNatives(tonic::DartLibraryNatives* natives);
37
38 private:
39 ImageShader();
40};
41
42} // namespace flutter
43
44#endif // FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
45