aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-21 11:23:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-21 11:23:46 -0700
commit0e4a466a613fa02292dfdbd8d4097fc14f191c42 (patch)
tree86507f238ac43d94664c18e55194f4ee256c1fb9 /src
parent39ef7fb885d7be648b9f0ecd027bc400d1213cec (diff)
Use sk_careful_memcpy when writing optional conic weights for GrShape path data key.
TBR=robertphillips@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2359933002 NO_DEPENDENCY_CHECKS=true Review-Url: https://codereview.chromium.org/2359933002
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrShape.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp
index b3c1e0a4cc..12fdd3bc14 100644
--- a/src/gpu/GrShape.cpp
+++ b/src/gpu/GrShape.cpp
@@ -89,7 +89,7 @@ static int path_key_from_data_size(const SkPath& path) {
}
// Writes the path data key into the passed pointer.
-static void write_path_key_from(const SkPath& path, uint32_t* origKey) {
+static void write_path_key_from_data(const SkPath& path, uint32_t* origKey) {
uint32_t* key = origKey;
// The check below should take care of negative values casted positive.
const int verbCnt = path.countVerbs();
@@ -109,7 +109,7 @@ static void write_path_key_from(const SkPath& path, uint32_t* origKey) {
memcpy(key, SkPathPriv::PointData(path), sizeof(SkPoint) * pointCnt);
GR_STATIC_ASSERT(sizeof(SkPoint) == 2 * sizeof(uint32_t));
key += 2 * pointCnt;
- memcpy(key, SkPathPriv::ConicWeightData(path), sizeof(SkScalar) * conicWeightCnt);
+ sk_careful_memcpy(key, SkPathPriv::ConicWeightData(path), sizeof(SkScalar) * conicWeightCnt);
GR_STATIC_ASSERT(sizeof(SkScalar) == sizeof(uint32_t));
SkDEBUGCODE(key += conicWeightCnt);
SkASSERT(key - origKey == path_key_from_data_size(path));
@@ -174,7 +174,7 @@ void GrShape::writeUnstyledKey(uint32_t* key) const {
case Type::kPath: {
int dataKeySize = path_key_from_data_size(fPathData.fPath);
if (dataKeySize >= 0) {
- write_path_key_from(fPathData.fPath, key);
+ write_path_key_from_data(fPathData.fPath, key);
return;
}
SkASSERT(fPathData.fGenID);