Subversion Repositories tpanel

Rev

Rev 179 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 179 Rev 184
Line 251... Line 251...
251
            if (alpha == 0)
251
            if (alpha == 0)
252
                pixel = pixelMask;
252
                pixel = pixelMask;
253
            // Skia has a bug and has changed the red and the blue color
253
            // Skia has a bug and has changed the red and the blue color
254
            // channel. Therefor we must change this 2 color channels for
254
            // channel. Therefor we must change this 2 color channels for
255
            // Linux based OSs here. On Android this is not necessary.
255
            // Linux based OSs here. On Android this is not necessary.
256
#ifdef __ANDROID__
256
//#ifdef __ANDROID__
257
            *wpix = pixel;
257
            *wpix = pixel;
258
#else   // We've to invert the pixels here to have the correct colors
258
//#else   // We've to invert the pixels here to have the correct colors
259
            uchar red   = SkColorGetR(pixel);   // This is blue in reality
259
//            uchar red   = SkColorGetR(pixel);   // This is blue in reality
260
            uchar green = SkColorGetG(pixel);
260
//            uchar green = SkColorGetG(pixel);
261
            uchar blue  = SkColorGetB(pixel);   // This is red in reality
261
//            uchar blue  = SkColorGetB(pixel);   // This is red in reality
262
            uchar al    = SkColorGetA(pixel);
262
//            uchar al    = SkColorGetA(pixel);
263
            *wpix = SkColorSetARGB(al, blue, green, red);
263
//            *wpix = SkColorSetARGB(al, blue, green, red);
264
#endif
264
//#endif
265
        }
265
        }
266
    }
266
    }
267
 
267
 
268
    return maskBm;
268
    return maskBm;
269
}
269
}
Line 281... Line 281...
281
    if (alpha == 0)
281
    if (alpha == 0)
282
        return maskPix;
282
        return maskPix;
283
 
283
 
284
    if (red && green)
284
    if (red && green)
285
    {
285
    {
286
#ifdef __ANDROID__
286
//#ifdef __ANDROID__
287
        uint newB = (SkColorGetR(col1) + SkColorGetR(col2) / 2) & 0x0ff;
287
//        uint newB = (SkColorGetR(col1) + SkColorGetR(col2) / 2) & 0x0ff;
288
        uint newG = (SkColorGetG(col1) + SkColorGetG(col2) / 2) & 0x0ff;
288
//        uint newG = (SkColorGetG(col1) + SkColorGetG(col2) / 2) & 0x0ff;
289
        uint newR = (SkColorGetB(col1) + SkColorGetB(col2) / 2) & 0x0ff;
289
//        uint newR = (SkColorGetB(col1) + SkColorGetB(col2) / 2) & 0x0ff;
290
#else
290
//#else
291
        uint newR = (SkColorGetR(col1) + SkColorGetR(col2) / 2) & 0x0ff;
291
        uint newR = (SkColorGetR(col1) + SkColorGetR(col2) / 2) & 0x0ff;
292
        uint newG = (SkColorGetG(col1) + SkColorGetG(col2) / 2) & 0x0ff;
292
        uint newG = (SkColorGetG(col1) + SkColorGetG(col2) / 2) & 0x0ff;
293
        uint newB = (SkColorGetB(col1) + SkColorGetB(col2) / 2) & 0x0ff;
293
        uint newB = (SkColorGetB(col1) + SkColorGetB(col2) / 2) & 0x0ff;
294
#endif
294
//#endif
295
        uint newA = (SkColorGetA(col1) + SkColorGetA(col2) / 2) & 0x0ff;
295
        uint newA = (SkColorGetA(col1) + SkColorGetA(col2) / 2) & 0x0ff;
296
 
296
 
297
        return SkColorSetARGB(newA, newR, newG, newB);
297
        return SkColorSetARGB(newA, newR, newG, newB);
298
    }
298
    }
299
 
299