Flutter Engine
image_filter.h
Go to the documentation of this file.
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_FILTER_H_
6 #define FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_
7 
8 #include "flutter/lib/ui/dart_wrapper.h"
9 #include "flutter/lib/ui/painting/image.h"
10 #include "flutter/lib/ui/painting/picture.h"
11 #include "third_party/skia/include/core/SkImageFilter.h"
13 
14 namespace flutter {
15 
16 class ImageFilter : public RefCountedDartWrappable<ImageFilter> {
17  DEFINE_WRAPPERTYPEINFO();
18  FML_FRIEND_MAKE_REF_COUNTED(ImageFilter);
19 
20  public:
21  ~ImageFilter() override;
23 
24  void initImage(CanvasImage* image);
25  void initPicture(Picture*);
26  void initBlur(double sigma_x, double sigma_y);
27  void initMatrix(const tonic::Float64List& matrix4, int filter_quality);
28 
29  const sk_sp<SkImageFilter>& filter() const { return filter_; }
30 
31  static void RegisterNatives(tonic::DartLibraryNatives* natives);
32 
33  private:
34  ImageFilter();
35 
36  sk_sp<SkImageFilter> filter_;
37 };
38 
39 } // namespace flutter
40 
41 #endif // FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_
void initImage(CanvasImage *image)
Definition: image_filter.cc:47
void initBlur(double sigma_x, double sigma_y)
Definition: image_filter.cc:55
~ImageFilter() override
Definition: image_filter.cc:45
static fml::RefPtr< ImageFilter > Create()
Definition: image_filter.cc:39
const sk_sp< SkImageFilter > & filter() const
Definition: image_filter.h:29
static void RegisterNatives(tonic::DartLibraryNatives *natives)
Definition: image_filter.cc:33
void initPicture(Picture *)
Definition: image_filter.cc:51
void initMatrix(const tonic::Float64List &matrix4, int filter_quality)
Definition: image_filter.cc:60