From 393551e338a3516606ad10b2d6342e16dd3ac610 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 19 Jun 2015 10:52:25 -0700 Subject: Move rect_memcopy from helper to global static. BUG=skia: Review URL: https://codereview.chromium.org/1197713003 --- src/core/SkConfig8888.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/SkConfig8888.h') 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 -- cgit v1.2.3