Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkEncodedInfo.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
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
10#include "modules/skcms/skcms.h"
11
12std::unique_ptr<SkEncodedInfo::ICCProfile> SkEncodedInfo::ICCProfile::Make(sk_sp<SkData> data) {
13 if (data) {
15 if (skcms_Parse(data->data(), data->size(), &profile)) {
16 return std::unique_ptr<ICCProfile>(new ICCProfile(profile, std::move(data)));
17 }
18 }
19 return nullptr;
20}
21
22std::unique_ptr<SkEncodedInfo::ICCProfile> SkEncodedInfo::ICCProfile::Make(
24 return std::unique_ptr<ICCProfile>(new ICCProfile(profile));
25}
26
27SkEncodedInfo::ICCProfile::ICCProfile(const skcms_ICCProfile& profile, sk_sp<SkData> data)
28 : fProfile(profile)
29 , fData(std::move(data))
30{}
const void * data() const
Definition SkData.h:37
size_t size() const
Definition SkData.h:30
const skcms_ICCProfile * profile() const
sk_sp< SkData > data() const
static std::unique_ptr< ICCProfile > Make(sk_sp< SkData >)
Definition ref_ptr.h:256
static bool skcms_Parse(const void *buf, size_t len, skcms_ICCProfile *profile)
const skcms_ICCProfile * profile() const