Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
image_shader.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_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"
16
17namespace flutter {
18
19class ImageShader : public Shader {
20 DEFINE_WRAPPERTYPEINFO();
22
23 public:
24 ~ImageShader() override;
25 static void Create(Dart_Handle wrapper);
26
30 int filter_quality_index,
31 Dart_Handle matrix_handle);
32
33 std::shared_ptr<DlColorSource> shader(DlImageSampling) override;
34
35 int width();
36 int height();
37
38 void dispose();
39
40 private:
42
44 bool sampling_is_locked_;
45
46 std::shared_ptr<DlImageColorSource> cached_shader_;
47};
48
49} // namespace flutter
50
51#endif // FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
static sk_sp< Effect > Create()
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
~ImageShader() override
Dart_Handle initWithImage(CanvasImage *image, DlTileMode tmx, DlTileMode tmy, int filter_quality_index, Dart_Handle matrix_handle)
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
sk_sp< SkImage > image
Definition examples.cpp:29
SkTileMode tmy
SkTileMode tmx
#define FML_FRIEND_MAKE_REF_COUNTED(T)