From 393551e338a3516606ad10b2d6342e16dd3ac610 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 19 Jun 2015 10:52:25 -0700 Subject: [PATCH] Move rect_memcopy from helper to global static. BUG=skia: Review URL: https://codereview.chromium.org/1197713003 --- src/core/SkConfig8888.cpp | 13 +------------ src/core/SkConfig8888.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/SkConfig8888.cpp b/src/core/SkConfig8888.cpp index d28941c27c..f49ab45c67 100644 --- a/src/core/SkConfig8888.cpp +++ b/src/core/SkConfig8888.cpp @@ -126,17 +126,6 @@ bool SkSrcPixelInfo::convertPixelsTo(SkDstPixelInfo* dst, int width, int height) return true; } -static void rect_memcpy(void* dst, size_t dstRB, const void* src, size_t srcRB, size_t bytesPerRow, - int rowCount) { - SkASSERT(bytesPerRow <= srcRB); - SkASSERT(bytesPerRow <= dstRB); - for (int i = 0; i < rowCount; ++i) { - memcpy(dst, src, bytesPerRow); - dst = (char*)dst + dstRB; - src = (const char*)src + srcRB; - } -} - static void copy_g8_to_32(void* dst, size_t dstRB, const void* src, size_t srcRB, int w, int h) { uint32_t* dst32 = (uint32_t*)dst; const uint8_t* src8 = (const uint8_t*)src; @@ -222,7 +211,7 @@ bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t default: return false; } - rect_memcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPerPixel(), height); + SkRectMemcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPerPixel(), height); return true; } diff --git a/src/core/SkConfig8888.h b/src/core/SkConfig8888.h index 274e3e57c2..954f2b5387 100644 --- a/src/core/SkConfig8888.h +++ b/src/core/SkConfig8888.h @@ -34,4 +34,15 @@ struct SkSrcPixelInfo : SkPixelInfo { bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; }; +static inline void SkRectMemcpy(void* dst, size_t dstRB, const void* src, size_t srcRB, + size_t bytesPerRow, int rowCount) { + SkASSERT(bytesPerRow <= srcRB); + SkASSERT(bytesPerRow <= dstRB); + for (int i = 0; i < rowCount; ++i) { + memcpy(dst, src, bytesPerRow); + dst = (char*)dst + dstRB; + src = (const char*)src + srcRB; + } +} + #endif