From 2bbc2c945bb0ecf18fd6473af74ad1a2f5e727a7 Mon Sep 17 00:00:00 2001 From: "scroggo@google.com" Date: Fri, 14 Jun 2013 15:33:20 +0000 Subject: Add an option to create unpremultiplied bitmaps. Currently they cannot be used directly by Skia, but the pixels can be used elsewhere. SkImageDecoder: Add functions to require unpremultiplied output and query the presence of the requirement SkImageDecoder_libpng: SkImageDecoder_libwebp: SkImageDecoder_WIC: Respect the requirement for unpremultiplied output. TODO: Fix SkImageDecoder_CG. SkScaledBitmapSampler: Add procs to skip premultiplication and a boolean parameter to use those procs. ImageDecodingTest: Test unpremultiplied bitmap decoding. SampleUnpremul: Add a sample which allows visually comparing between the unpremultiplied version (copied into a premultiplied bitmap, since drawing unpremultiplied is not currently supported) and a premultiplied version of image files. gm.h: Add a getter for the resource path, so Samples can use it. As of patch set 13, https://codereview.chromium.org/16816016/ and https://codereview.chromium.org/16983004/, which were approved separately. R=reed@google.com Review URL: https://codereview.chromium.org/16410009 git-svn-id: http://skia.googlecode.com/svn/trunk@9612 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleColorFilter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'samplecode/SampleColorFilter.cpp') diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp index 41392ac248..126ee4736d 100644 --- a/samplecode/SampleColorFilter.cpp +++ b/samplecode/SampleColorFilter.cpp @@ -84,7 +84,8 @@ static void test_5bits() { SkDebugf("--- trunc: %d %d round: %d %d new: %d %d\n", e0, ae0, e1, ae1, e2, ae2); } -static SkShader* createChecker() { +// No longer marked static, since it is externed in SampleUnpremul. +SkShader* createChecker() { SkBitmap bm; bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); bm.allocPixels(); -- cgit v1.2.3