From 5a7c6be72b940dde8ff6ad2485a09aecd56a2660 Mon Sep 17 00:00:00 2001 From: "scroggo@google.com" Date: Thu, 4 Oct 2012 21:46:08 +0000 Subject: Add the ability to provide function pointers to SkPicture serialization and deserialization for encoding and decoding bitmaps. Remove kForceFlattenBitmapPixels_Flag, which is no longer used. When an SkOrderedReadBuffer needs to read a bitmap, if it does not have an image decoder, use a dummy bitmap. In GM, add a tolerance option for color differences, used when testing picture serialization, so it can assume two images are the same even though PNG encoding/decoding may have resulted in small differences. Create dummy implementations for SkImageDecoder and SkImageEncoder functions in SkImageDecoder_empty so that a project that does not want to include the images project it can still build. Allow ports to build without images project. In Mac's image encoder, copy 4444 to 8888 before encoding. Add SkWriter32::reservePad, to provide a pointer to write non 4 byte aligned data, padded with zeroes. In bench_ and render_ pictures, pass decode function to SkPicture creation from a stream. BUG=https://code.google.com/p/skia/issues/detail?id=842 Review URL: https://codereview.appspot.com/6551071 git-svn-id: http://skia.googlecode.com/svn/trunk@5818 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/images/SkImages.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/images/SkImages.cpp (limited to 'src/images') diff --git a/src/images/SkImages.cpp b/src/images/SkImages.cpp new file mode 100644 index 0000000000..28dfd7f615 --- /dev/null +++ b/src/images/SkImages.cpp @@ -0,0 +1,16 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkFlattenable.h" +#include "SkFlipPixelRef.h" +#include "SkImageRef_GlobalPool.h" +#include "SkImages.h" + +void SkImages::InitializeFlattenables() { + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkFlipPixelRef) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageRef_GlobalPool) +} -- cgit v1.2.3