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