Flutter Engine
The Flutter Engine
third_party
skia
src
base
SkRectMemcpy.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkRectMemcpy_DEFINED
9
#define SkRectMemcpy_DEFINED
10
11
#include "
include/private/base/SkAssert.h
"
12
#include "
include/private/base/SkTemplates.h
"
13
14
#include <cstring>
15
16
static
inline
void
SkRectMemcpy
(
void
*
dst
,
size_t
dstRB,
const
void
*
src
,
size_t
srcRB,
17
size_t
trimRowBytes,
int
rowCount) {
18
SkASSERT
(trimRowBytes <= dstRB);
19
SkASSERT
(trimRowBytes <= srcRB);
20
if
(trimRowBytes == dstRB && trimRowBytes == srcRB) {
21
memcpy(
dst
,
src
, trimRowBytes * rowCount);
22
return
;
23
}
24
25
for
(
int
i
= 0;
i
< rowCount; ++
i
) {
26
memcpy(
dst
,
src
, trimRowBytes);
27
dst
= SkTAddOffset<void>(
dst
, dstRB);
28
src
= SkTAddOffset<const void>(
src
, srcRB);
29
}
30
}
31
32
#endif
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkRectMemcpy
static void SkRectMemcpy(void *dst, size_t dstRB, const void *src, size_t srcRB, size_t trimRowBytes, int rowCount)
Definition:
SkRectMemcpy.h:16
SkTemplates.h
i
int i
Definition:
fl_socket_accessible.cc:18
gn.cp.dst
dst
Definition:
cp.py:12
mskp_parser.src
src
Definition:
mskp_parser.py:22
Generated on Sun Jun 23 2024 21:56:09 for Flutter Engine by
1.9.4