Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
display_list
image
dl_image.cc
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
#include "flutter/display_list/image/dl_image.h"
6
7
#include "flutter/display_list/image/dl_image_skia.h"
8
9
namespace
flutter
{
10
11
sk_sp<DlImage>
DlImage::Make
(
const
SkImage
*
image
) {
12
return
Make
(
sk_ref_sp
(
image
));
13
}
14
15
sk_sp<DlImage>
DlImage::Make
(
sk_sp<SkImage>
image
) {
16
return
sk_make_sp<DlImageSkia>(std::move(
image
));
17
}
18
19
DlImage::DlImage
() =
default
;
20
21
DlImage::~DlImage
() =
default
;
22
23
int
DlImage::width
()
const
{
24
return
dimensions
().
fWidth
;
25
};
26
27
int
DlImage::height
()
const
{
28
return
dimensions
().
fHeight
;
29
};
30
31
SkIRect
DlImage::bounds
()
const
{
32
return
SkIRect::MakeSize
(
dimensions
());
33
}
34
35
std::optional<std::string>
DlImage::get_error
()
const
{
36
return
std::nullopt;
37
}
38
39
}
// namespace flutter
sk_ref_sp
sk_sp< T > sk_ref_sp(T *obj)
Definition
SkRefCnt.h:381
SkImage
Definition
SkImage.h:272
flutter::DlImage::get_error
virtual std::optional< std::string > get_error() const
Definition
dl_image.cc:35
flutter::DlImage::height
int height() const
Definition
dl_image.cc:27
flutter::DlImage::DlImage
DlImage()
flutter::DlImage::bounds
SkIRect bounds() const
Definition
dl_image.cc:31
flutter::DlImage::Make
static sk_sp< DlImage > Make(const SkImage *image)
Definition
dl_image.cc:11
flutter::DlImage::~DlImage
virtual ~DlImage()
flutter::DlImage::dimensions
virtual SkISize dimensions() const =0
flutter::DlImage::width
int width() const
Definition
dl_image.cc:23
sk_sp
Definition
SkRefCnt.h:220
image
sk_sp< SkImage > image
Definition
examples.cpp:29
flutter
Definition
asset_manager.cc:10
SkIRect
Definition
SkRect.h:32
SkIRect::MakeSize
static constexpr SkIRect MakeSize(const SkISize &size)
Definition
SkRect.h:66
SkISize::fHeight
int32_t fHeight
Definition
SkSize.h:18
SkISize::fWidth
int32_t fWidth
Definition
SkSize.h:17
Generated on Fri Apr 26 2024 06:14:02 for Flutter Engine by
1.9.8