From c6fe3efe6c9c9356843860863a0fb4114536b86c Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 1 Nov 2021 10:47:28 -0400 Subject: [PATCH] GIFMovie: Stop using internal Skia APIs Bug: 178700363 Test: manual Instead of using sk_memset32, which is private to Skia, use regular memset. Skia recently moved sk_memset32, resulting in a build breakage. But it's not obvious that this deprecated class needs the faster version of memset. Also remove an include of SkTemplates, which is no longer used. Change-Id: Iae6b495e5aace3ea92d2fc59798ea3fd23d3b1b9 --- libs/hwui/jni/GIFMovie.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/hwui/jni/GIFMovie.cpp b/libs/hwui/jni/GIFMovie.cpp index c5c47116b5a6a..fef51b8d2f795 100644 --- a/libs/hwui/jni/GIFMovie.cpp +++ b/libs/hwui/jni/GIFMovie.cpp @@ -10,13 +10,13 @@ #include "SkColor.h" #include "SkColorPriv.h" #include "SkStream.h" -#include "SkTemplates.h" -#include "SkUtils.h" #include "gif_lib.h" #include +#include + #if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0) #define DGifCloseFile(a, b) DGifCloseFile(a) #endif @@ -219,8 +219,9 @@ static void fillRect(SkBitmap* bm, GifWord left, GifWord top, GifWord width, Gif copyHeight = bmHeight - top; } + size_t bytes = copyWidth * SkColorTypeBytesPerPixel(bm->colorType()); for (; copyHeight > 0; copyHeight--) { - sk_memset32(dst, col, copyWidth); + memset(dst, col, bytes); dst += bmWidth; } }