chromium/third_party/skia/src/core/SkMipmapHQDownSampler.cpp

/*
 * Copyright 2023 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "include/core/SkTypes.h"

#ifndef SK_USE_DRAWING_MIPMAP_DOWNSAMPLER

#include "include/private/SkColorData.h"
#include "src/base/SkHalf.h"
#include "src/base/SkVx.h"
#include "src/core/SkMipmap.h"

namespace {

struct ColorTypeFilter_8888 {};

struct ColorTypeFilter_565 {};

struct ColorTypeFilter_4444 {};

struct ColorTypeFilter_8 {};

struct ColorTypeFilter_Alpha_F16 {};

struct ColorTypeFilter_RGBA_F16 {};

struct ColorTypeFilter_88 {};

struct ColorTypeFilter_1616 {};

struct ColorTypeFilter_F16F16 {};

struct ColorTypeFilter_16161616 {};

struct ColorTypeFilter_16 {};

struct ColorTypeFilter_1010102 {};

template <typename T> T add_121(const T& a, const T& b, const T& c) {}

template <typename T> T shift_right(const T& x, int bits) {}

skvx::float4 shift_right(const skvx::float4& x, int bits) {}

template <typename T> T shift_left(const T& x, int bits) {}

skvx::float4 shift_left(const skvx::float4& x, int bits) {}

//
//  To produce each mip level, we need to filter down by 1/2 (e.g. 100x100 -> 50,50)
//  If the starting dimension is odd, we floor the size of the lower level (e.g. 101 -> 50)
//  In those (odd) cases, we use a triangle filter, with 1-pixel overlap between samplings,
//  else for even cases, we just use a 2x box filter.
//
//  This produces 4 possible isotropic filters: 2x2 2x3 3x2 3x3 where WxH indicates the number of
//  src pixels we need to sample in each dimension to produce 1 dst pixel.
//
//  OpenGL expects a full mipmap stack to contain anisotropic space as well.
//  This means a 100x1 image would continue down to a 50x1 image, 25x1 image...
//  Because of this, we need 4 more anisotropic filters: 1x2, 1x3, 2x1, 3x1.

template <typename F> void downsample_1_2(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_1_3(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_2_1(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_2_2(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_2_3(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_3_1(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_3_2(void* dst, const void* src, size_t srcRB, int count) {}

template <typename F> void downsample_3_3(void* dst, const void* src, size_t srcRB, int count) {}


FilterProc;

struct HQDownSampler : SkMipmapDownSampler {};

void HQDownSampler::buildLevel(const SkPixmap& dst, const SkPixmap& src) {}

} // namespace

std::unique_ptr<SkMipmapDownSampler> SkMipmap::MakeDownSampler(const SkPixmap& root) {}

#endif