diff options
author | Leon Scroggins III <scroggo@google.com> | 2018-05-30 15:33:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-01 12:53:25 +0000 |
commit | 22f673d42087853a151fcd5e95c129be83065cdc (patch) | |
tree | e4e711677a1e6a02b261acd9346c587ff260d7a0 /src/codec/SkColorTable.cpp | |
parent | 9ea47bedb945fe51c7805b4f2defccccb8249865 (diff) |
Move SkColorTable to src/codec
It is no longer needed anywhere else, and simply happens to be an
implementation detail of SkCodec (at least for now).
Remove references to SkColorTable in other classes, and clean up some
includes of SkConvertPixels I found along the way.
Remove unused includes/methods on SkColorTable
Change-Id: I46c8e46f5b77c37710b6cf595d48107d55871d52
Reviewed-on: https://skia-review.googlesource.com/130845
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/codec/SkColorTable.cpp')
-rw-r--r-- | src/codec/SkColorTable.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/codec/SkColorTable.cpp b/src/codec/SkColorTable.cpp index ae6716b3f6..5699d87c2b 100644 --- a/src/codec/SkColorTable.cpp +++ b/src/codec/SkColorTable.cpp @@ -1,8 +1,23 @@ /* - * Copyright 2018 Google Inc. + * Copyright 2009 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -// Dummy file to assist in landing https://skia-review.googlesource.com/c/skia/+/130845 +#include "SkColorTable.h" +#include "../private/SkMalloc.h" + +SkColorTable::SkColorTable(const SkPMColor colors[], int count) { + SkASSERT(0 == count || colors); + SkASSERT(count >= 0 && count <= 256); + + fCount = count; + fColors = reinterpret_cast<SkPMColor*>(sk_malloc_throw(count * sizeof(SkPMColor))); + + memcpy(fColors, colors, count * sizeof(SkPMColor)); +} + +SkColorTable::~SkColorTable() { + sk_free(fColors); +} |