Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrImageInfo.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
12
13#include <utility>
14
15GrImageInfo::GrImageInfo() = default;
16
18 : fColorInfo(info.colorInfo()), fDimensions(info.dimensions()) {}
19
21 : fColorInfo(ct, at, std::move(cs)), fDimensions{w,h} {}
22
24 const SkISize& dimensions)
25 : fColorInfo(ct, at, std::move(cs)), fDimensions(dimensions) {}
26
28 : fColorInfo(info), fDimensions(dimensions) {}
29
31 : fColorInfo(std::move(info)), fDimensions(dimensions) {}
32
37
39 return {this->colorInfo().makeColorType(ct), this->dimensions()};
40}
41
43 return {this->colorType(), at, this->refColorSpace(), this->width(), this->height()};
44}
45
47 return {this->colorType(), this->alphaType(), std::move(cs), this->width(), this->height()};
48}
49
51 return {this->colorType(), this->alphaType(), this->refColorSpace(), dimensions};
52}
53
55 return {this->colorType(), this->alphaType(), this->refColorSpace(), width, height};
56}
57
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
GrColorType
SkAlphaType
Definition SkAlphaType.h:26
sk_sp< SkColorSpace > refColorSpace() const
GrColorInfo makeColorType(GrColorType ct) const
SkAlphaType alphaType() const
Definition GrImageInfo.h:46
int width() const
Definition GrImageInfo.h:54
GrImageInfo makeWH(int width, int height) const
GrImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
GrImageInfo makeColorType(GrColorType ct) const
SkISize dimensions() const
Definition GrImageInfo.h:52
GrImageInfo makeDimensions(SkISize dimensions) const
const GrColorInfo & colorInfo() const
Definition GrImageInfo.h:42
sk_sp< SkColorSpace > refColorSpace() const
GrImageInfo & operator=(const GrImageInfo &)
GrColorType colorType() const
Definition GrImageInfo.h:44
int height() const
Definition GrImageInfo.h:56
GrImageInfo makeAlphaType(SkAlphaType at) const
Definition ref_ptr.h:256
SkScalar w
SkScalar h
int32_t height
int32_t width