Add safety net logging for issue 118143775

Bug: b/118143775
Change-Id: I79d932a83753cb01d34afe15b91fda860ca35749
Reviewed-on: https://skia-review.googlesource.com/c/171227
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This commit is contained in:
Leon Scroggins III 2018-11-15 14:17:01 -05:00 committed by Skia Commit-Bot
parent 5bf5a64fe7
commit b3d2760e2f

View File

@ -12,6 +12,10 @@
#include "SkSwizzler.h"
#include "SkTemplates.h"
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
#include "SkAndroidFrameworkUtils.h"
#endif
static void copy(void* dst, const uint8_t* src, int width, int bpp, int deltaSrc, int offset,
const SkPMColor ctable[]) {
// This function must not be called if we are sampling. If we are not
@ -1206,6 +1210,9 @@ int SkSwizzler::onSetSampleX(int sampleX) {
const size_t dstSwizzleBytes = fSwizzleWidth * fDstBPP;
const size_t dstAllocatedBytes = fAllocatedWidth * fDstBPP;
if (fDstOffsetBytes + dstSwizzleBytes > dstAllocatedBytes) {
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
SkAndroidFrameworkUtils::SafetyNetLog("118143775");
#endif
SkASSERT(dstSwizzleBytes < dstAllocatedBytes);
fDstOffsetBytes = dstAllocatedBytes - dstSwizzleBytes;
}