Flutter Engine
The Flutter Engine
third_party
skia
src
codec
SkColorPalette.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2009 The Android Open Source Project
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
#include "
src/codec/SkColorPalette.h
"
8
9
#include "
include/private/base/SkMalloc.h
"
10
11
#include <cstring>
12
13
SkColorPalette::SkColorPalette
(
const
SkPMColor
colors
[],
int
count
) {
14
SkASSERT
(0 ==
count
||
colors
);
15
SkASSERT
(
count
>= 0 &&
count
<= 256);
16
17
fCount =
count
;
18
fColors =
reinterpret_cast<
SkPMColor
*
>
(
sk_malloc_throw
(
count
*
sizeof
(
SkPMColor
)));
19
20
memcpy(fColors,
colors
,
count
*
sizeof
(
SkPMColor
));
21
}
22
23
SkColorPalette::~SkColorPalette
() {
24
sk_free
(fColors);
25
}
count
int count
Definition:
FontMgrTest.cpp:50
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkColorPalette.h
SkPMColor
uint32_t SkPMColor
Definition:
SkColor.h:205
SkMalloc.h
sk_free
SK_API void sk_free(void *)
Definition:
SkMemory_malloc.cpp:83
sk_malloc_throw
static void * sk_malloc_throw(size_t size)
Definition:
SkMalloc.h:67
SkColorPalette::SkColorPalette
SkColorPalette(const SkPMColor colors[], int count)
Definition:
SkColorPalette.cpp:13
SkColorPalette::count
int count() const
Definition:
SkColorPalette.h:31
SkColorPalette::~SkColorPalette
~SkColorPalette() override
Definition:
SkColorPalette.cpp:23
SkRecords::colors
PODArray< SkColor > colors
Definition:
SkRecords.h:276
Generated on Sun Jun 23 2024 21:56:09 for Flutter Engine by
1.9.4