Flutter Engine
The Flutter Engine
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 */
8
10
11#include <cstring>
12
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
24 sk_free(fColors);
25}
int count
Definition: FontMgrTest.cpp:50
#define SkASSERT(cond)
Definition: SkAssert.h:116
uint32_t SkPMColor
Definition: SkColor.h:205
SK_API void sk_free(void *)
static void * sk_malloc_throw(size_t size)
Definition: SkMalloc.h:67
SkColorPalette(const SkPMColor colors[], int count)
int count() const
~SkColorPalette() override
PODArray< SkColor > colors
Definition: SkRecords.h:276