Move sk_memset* from SkUtils to SkOpts

This is a (hopefully) more careful reland of parts of
https://skia-review.googlesource.com/c/skia/+/464876

Change-Id: I32dd6777a70d983d8a66a4bf9557cab6e3d7ebc2
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467124
Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Kevin Lubick 2021-11-03 08:49:00 -04:00
parent e0ee095fa2
commit 3a9a7991c4
22 changed files with 33 additions and 35 deletions

View File

@ -7,7 +7,7 @@
#include "bench/Benchmark.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
template <typename T>
class MemsetBench : public Benchmark {

View File

@ -20,7 +20,6 @@
#include "src/codec/SkPngPriv.h"
#include "src/codec/SkSwizzler.h"
#include "src/core/SkOpts.h"
#include "src/core/SkUtils.h"
#include "png.h"
#include <algorithm>

View File

@ -8,7 +8,7 @@
#include "include/codec/SkCodec.h"
#include "src/codec/SkCodecPriv.h"
#include "src/codec/SkSampler.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
void SkSampler::Fill(const SkImageInfo& info, void* dst, size_t rowBytes,
SkCodec::ZeroInitialized zeroInit) {

View File

@ -7,7 +7,7 @@
#include "include/private/SkTo.h"
#include "src/core/SkAntiRun.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
void SkAlphaRuns::reset(int width) {
SkASSERT(width > 0);

View File

@ -17,7 +17,6 @@
#include "src/core/SkMipmapAccessor.h"
#include "src/core/SkOpts.h"
#include "src/core/SkResourceCache.h"
#include "src/core/SkUtils.h"
// One-stop-shop shader for,
// - nearest-neighbor sampling (_nofilter_),

View File

@ -9,7 +9,7 @@
#include "include/private/SkTPin.h"
#include "include/private/SkTo.h"
#include "src/core/SkBitmapProcState.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
/*
* The decal_ functions require that

View File

@ -8,7 +8,6 @@
#include "include/private/SkColorData.h"
#include "src/core/SkBlitRow.h"
#include "src/core/SkOpts.h"
#include "src/core/SkUtils.h"
// Everyone agrees memcpy() is the best way to do this.
static void blit_row_s32_opaque(SkPMColor* dst,

View File

@ -17,11 +17,11 @@
#include "src/core/SkMask.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkMatrixProvider.h"
#include "src/core/SkOpts.h"
#include "src/core/SkPaintPriv.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkRegionPriv.h"
#include "src/core/SkTLazy.h"
#include "src/core/SkUtils.h"
#include "src/core/SkVMBlitter.h"
#include "src/core/SkWriteBuffer.h"
#include "src/core/SkXfermodeInterpretation.h"

View File

@ -9,7 +9,7 @@
#include "include/private/SkColorData.h"
#include "include/private/SkVx.h"
#include "src/core/SkCoreBlitters.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "src/core/SkXfermodePriv.h"
static inline int upscale_31_to_32(int value) {

View File

@ -23,13 +23,13 @@
#include "src/core/SkLatticeIter.h"
#include "src/core/SkMarkerStack.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkOpts.h"
#include "src/core/SkPathPriv.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkRectPriv.h"
#include "src/core/SkSpecialImage.h"
#include "src/core/SkTLazy.h"
#include "src/core/SkTextBlobPriv.h"
#include "src/core/SkUtils.h"
#include "src/image/SkImage_Base.h"
#include "src/shaders/SkLocalMatrixShader.h"
#include "src/utils/SkPatchUtils.h"

View File

@ -82,4 +82,19 @@ namespace SkOpts {
int n, void* args[]);
} // namespace SkOpts
/** Similar to memset(), but it assigns a 16, 32, or 64-bit value into the buffer.
@param buffer The memory to have value copied into it
@param value The value to be copied into buffer
@param count The number of times value should be copied into the buffer.
*/
static inline void sk_memset16(uint16_t buffer[], uint16_t value, int count) {
SkOpts::memset16(buffer, value, count);
}
static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) {
SkOpts::memset32(buffer, value, count);
}
static inline void sk_memset64(uint64_t buffer[], uint64_t value, int count) {
SkOpts::memset64(buffer, value, count);
}
#endif//SkOpts_DEFINED

View File

@ -9,24 +9,8 @@
#define SkUtils_DEFINED
#include "include/core/SkTypes.h"
#include "src/core/SkOpts.h"
/** Similar to memset(), but it assigns a 16, 32, or 64-bit value into the buffer.
@param buffer The memory to have value copied into it
@param value The value to be copied into buffer
@param count The number of times value should be copied into the buffer.
*/
static inline void sk_memset16(uint16_t buffer[], uint16_t value, int count) {
SkOpts::memset16(buffer, value, count);
}
static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) {
SkOpts::memset32(buffer, value, count);
}
static inline void sk_memset64(uint64_t buffer[], uint64_t value, int count) {
SkOpts::memset64(buffer, value, count);
}
///////////////////////////////////////////////////////////////////////////////
#include <type_traits> // is_trivially_copyable
namespace SkHexadecimalDigits {
extern const char gUpper[16]; // 0-9A-F

View File

@ -14,6 +14,7 @@
#include "src/core/SkConvertPixels.h"
#include "src/core/SkMathPriv.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkTLazy.h"
#include "src/core/SkTraceEvent.h"
#include "src/core/SkUtils.h"

View File

@ -39,7 +39,7 @@
#include "src/core/SkMask.h"
#include "src/core/SkMaskGamma.h"
#include "src/core/SkMathPriv.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "src/ports/SkScalerContext_mac_ct.h"
#include "src/ports/SkTypeface_mac_ct.h"
#include "src/sfnt/SkOTTableTypes.h"

View File

@ -13,7 +13,7 @@
#include "include/private/SkColorData.h"
#include "include/private/SkHalf.h"
#include "include/private/SkNx.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
// Templates shared by various 4f gradient flavors.

View File

@ -20,7 +20,7 @@
#include "include/gpu/GrDirectContext.h"
#include "include/private/GrTypesPriv.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrShaderCaps.h"

View File

@ -14,6 +14,7 @@
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/core/SkTypes.h"
#include "src/core/SkOpts.h"
#include "tests/Test.h"
#include "tools/ToolUtils.h"

View File

@ -14,7 +14,7 @@
#include "include/core/SkRefCnt.h"
#include "include/core/SkTypes.h"
#include "include/private/SkColorData.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "tests/Test.h"
#include "tools/ToolUtils.h"

View File

@ -14,7 +14,7 @@
#include "include/gpu/GrTypes.h"
#include "include/private/GrTypesPriv.h"
#include "include/private/SkTemplates.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrImageInfo.h"

View File

@ -25,7 +25,7 @@
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "src/gpu/GrDirectContextPriv.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrImageContextPriv.h"

View File

@ -6,7 +6,7 @@
*/
#include "include/utils/SkRandom.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "tests/Test.h"
static void set_zero(void* dst, size_t bytes) {

View File

@ -12,7 +12,7 @@
#include "src/core/SkAutoPixmapStorage.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkUtils.h"
#include "src/core/SkOpts.h"
#include "tools/flags/CommandLineFlags.h"
#include "tools/fiddle/fiddle_main.h"