From 263cb3a79c42ba5ecb7b3ef0752083cacbbffb4e Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Tue, 20 Dec 2011 14:35:32 +0000 Subject: [PATCH] can't pass const to setPixels :( git-svn-id: http://skia.googlecode.com/svn/trunk@2900 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/xfermodes.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp index 5150727c9d..42b8a6a8ab 100644 --- a/gm/xfermodes.cpp +++ b/gm/xfermodes.cpp @@ -38,8 +38,6 @@ static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst) { c.drawRect(r, p); } -static const uint16_t gBG[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF }; - class XfermodesGM : public GM { SkBitmap fBG; SkBitmap fSrcB, fDstB; @@ -57,11 +55,11 @@ class XfermodesGM : public GM { void init() { if (!fOnce) { - // Do all this work in a temporary so we get a deep copy, - // especially of gBG. + // Do all this work in a temporary so we get a deep copy + uint16_t localData[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF }; SkBitmap scratchBitmap; scratchBitmap.setConfig(SkBitmap::kARGB_4444_Config, 2, 2, 4); - scratchBitmap.setPixels(gBG); + scratchBitmap.setPixels(localData); scratchBitmap.setIsOpaque(true); scratchBitmap.copyTo(&fBG, SkBitmap::kARGB_4444_Config);