Flutter Engine
The Flutter Engine
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();
21 FML_FRIEND_MAKE_REF_COUNTED(ImageShader);
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_
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
Definition: image_shader.cc:50
~ImageShader() override
Dart_Handle initWithImage(CanvasImage *image, DlTileMode tmx, DlTileMode tmy, int filter_quality_index, Dart_Handle matrix_handle)
Definition: image_shader.cc:26
static void Create(Dart_Handle wrapper)
Definition: image_shader.cc:21
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SkTileMode tmy
SkTileMode tmx