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
13#include "third_party/skia/include/core/SkMatrix.h"
14#include "third_party/skia/include/core/SkShader.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
27 Dart_Handle initWithImage(CanvasImage* image,
28 DlTileMode tmx,
29 DlTileMode tmy,
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
43 sk_sp<const DlImage> image_;
44 bool sampling_is_locked_;
45
46 std::shared_ptr<DlColorSource> cached_shader_;
47};
48
49} // namespace flutter
50
51#endif // FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_
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)
static void Create(Dart_Handle wrapper)
FlutterVulkanImage * image
#define FML_FRIEND_MAKE_REF_COUNTED(T)