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:
parent
e0ee095fa2
commit
3a9a7991c4
@ -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 {
|
||||
|
@ -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>
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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_),
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user