android编译skia静态库时,图片解码库无法注册的问题

经过千辛万苦将skia编译成了静态库,但是发现图片解码都不成功,后来发现是图片解码库没有注册成功,可能是代码优化导致的,但是加上-O0编译选项也不行。后来就在SkImageDecoder_Factory.cpp中直接调用各个解码库的注册文件,结果png解码可以了,但是jpeg和gif编译不通过,后来发现时需要一个-fvisibility=hidden编译选项,增加后就OK了。修改的skia文件如下:

SkImageDecoder_Factory.cpp

SkImageDecoder_Factory.cpp
/* libs/graphics/ports/SkImageDecoder_Factory.cpp

**

** Copyright 2006, The Android Open Source Project

**

** Licensed under the Apache License, Version 2.0 (the "License"); 

** you may not use this file except in compliance with the License. 

** You may obtain a copy of the License at 

**

**     http://www.apache.org/licenses/LICENSE-2.0 

**

** Unless required by applicable law or agreed to in writing, software 

** distributed under the License is distributed on an "AS IS" BASIS, 

** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

** See the License for the specific language governing permissions and 

** limitations under the License.

*/



#include "SkImageDecoder.h"

#include "SkMovie.h"

#include "SkStream.h"

#include "SkTRegistry.h"

#include "dhlog.h"



typedef SkTRegistry<SkImageDecoder*, SkStream*> DecodeReg;



// N.B. You can't use "DecodeReg::gHead here" due to complex C++

// corner cases.

template DecodeReg* SkTRegistry<SkImageDecoder*, SkStream*>::gHead;



#ifdef SK_ENABLE_LIBPNG

    extern SkImageDecoder* sk_libpng_dfactory(SkStream*);

#endif

#ifdef SK_ENABLE_LIBJPEG

    extern SkImageDecoder* sk_libjpeg_dfactory(SkStream*);

#endif

#ifdef SK_ENABLE_LIBGIF

    extern SkImageDecoder* sk_libgif_dfactory(SkStream*);

#endif



SkImageDecoder* SkImageDecoder::Factory(SkStream* stream) {

    SkImageDecoder* codec = NULL;

    const DecodeReg* curr = DecodeReg::Head();

    logdh("SkImageDecoder::Factory curr=0x%x", curr);

    while (curr) {

        codec = curr->factory()(stream);

        logdh("SkImageDecoder::Factory stream=0x%x codec=0x%x", stream, codec);

        // we rewind here, because we promise later when we call "decode", that

        // the stream will be at its beginning.

        stream->rewind();

        if (codec) {

            return codec;

        }

        curr = curr->next();

    }

#ifdef SK_ENABLE_LIBPNG

    codec = sk_libpng_dfactory(stream);

    if (codec) {

        stream->rewind();

        return codec;

    }

#endif

#ifdef SK_ENABLE_LIBJPEG

    logdh("SkImageDecoder::Factory enter SK_ENABLE_LIBJPEG");

    //for jpeg decode



    codec = sk_libjpeg_dfactory(stream);

    if (codec) {

        logdh("SkImageDecoder::Factory codec=0x%x ok", codec);

        stream->rewind();

        return codec;

    }

#endif

#ifdef SK_ENABLE_LIBGIF

    //for gif decode

    codec = sk_libgif_dfactory(stream);

    if (codec) {

        stream->rewind();

        return codec;

    }

#endif

    return NULL;

}



/////////////////////////////////////////////////////////////////////////



typedef SkTRegistry<SkMovie*, SkStream*> MovieReg;



SkMovie* SkMovie::DecodeStream(SkStream* stream) {

    const MovieReg* curr = MovieReg::Head();

    while (curr) {

        SkMovie* movie = curr->factory()(stream);

        if (movie) {

            return movie;

        }

        // we must rewind only if we got NULL, since we gave the stream to the

        // movie, who may have already started reading from it

        stream->rewind();

        curr = curr->next();

    }

    return NULL;

}

SkImageDecoder_libgif.cpp

SkImageDecoder_libgif.cpp
/* libs/graphics/images/SkImageDecoder_libgif.cpp

**

** Copyright 2006, The Android Open Source Project

**

** Licensed under the Apache License, Version 2.0 (the "License"); 

** you may not use this file except in compliance with the License. 

** You may obtain a copy of the License at 

**

**     http://www.apache.org/licenses/LICENSE-2.0 

**

** Unless required by applicable law or agreed to in writing, software 

** distributed under the License is distributed on an "AS IS" BASIS, 

** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

** See the License for the specific language governing permissions and 

** limitations under the License.

*/



#include "SkImageDecoder.h"

#include "SkColor.h"

#include "SkColorPriv.h"

#include "SkStream.h"

#include "SkTemplates.h"

#include "SkPackBits.h"



#include "gif_lib.h"



class SkGIFImageDecoder : public SkImageDecoder {

public:

    virtual Format getFormat() const {

        return kGIF_Format;

    }

    

protected:

    virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode);

};



static const uint8_t gStartingIterlaceYValue[] = {

    0, 4, 2, 1

};

static const uint8_t gDeltaIterlaceYValue[] = {

    8, 8, 4, 2

};



/*  Implement the GIF interlace algorithm in an iterator.

    1) grab every 8th line beginning at 0

    2) grab every 8th line beginning at 4

    3) grab every 4th line beginning at 2

    4) grab every 2nd line beginning at 1

*/

class GifInterlaceIter {

public:

    GifInterlaceIter(int height) : fHeight(height) {

        fStartYPtr = gStartingIterlaceYValue;

        fDeltaYPtr = gDeltaIterlaceYValue;



        fCurrY = *fStartYPtr++;

        fDeltaY = *fDeltaYPtr++;

    }

    

    int currY() const {

        SkASSERT(fStartYPtr);

        SkASSERT(fDeltaYPtr);

        return fCurrY;

    }



    void next() {

        SkASSERT(fStartYPtr);

        SkASSERT(fDeltaYPtr);



        int y = fCurrY + fDeltaY;

        // We went from an if statement to a while loop so that we iterate

        // through fStartYPtr until a valid row is found. This is so that images

        // that are smaller than 5x5 will not trash memory.

        while (y >= fHeight) {

            if (gStartingIterlaceYValue +

                    SK_ARRAY_COUNT(gStartingIterlaceYValue) == fStartYPtr) {

                // we done

                SkDEBUGCODE(fStartYPtr = NULL;)

                SkDEBUGCODE(fDeltaYPtr = NULL;)

                y = 0;

            } else {

                y = *fStartYPtr++;

                fDeltaY = *fDeltaYPtr++;

            }

        }

        fCurrY = y;

    }

    

private:

    const int fHeight;

    int fCurrY;

    int fDeltaY;

    const uint8_t* fStartYPtr;

    const uint8_t* fDeltaYPtr;

};



///////////////////////////////////////////////////////////////////////////////



//#define GIF_STAMP       "GIF"    /* First chars in file - GIF stamp. */

//#define GIF_STAMP_LEN   (sizeof(GIF_STAMP) - 1)



static int DecodeCallBackProc(GifFileType* fileType, GifByteType* out,

                              int size) {

    SkStream* stream = (SkStream*) fileType->UserData;

    return (int) stream->read(out, size);

}



void CheckFreeExtension(SavedImage* Image) {

    if (Image->ExtensionBlocks) {

        FreeExtension(Image);

    }

}



// return NULL on failure

static const ColorMapObject* find_colormap(const GifFileType* gif) {

    const ColorMapObject* cmap = gif->Image.ColorMap;

    if (NULL == cmap) {

        cmap = gif->SColorMap;

    }



    if (NULL == cmap) {

        // no colormap found

        return NULL;

    }

    // some sanity checks

    if (cmap && ((unsigned)cmap->ColorCount > 256 ||

                 cmap->ColorCount != (1 << cmap->BitsPerPixel))) {

        cmap = NULL;

    }

    return cmap;

}



// return -1 if not found (i.e. we're completely opaque)

static int find_transpIndex(const SavedImage& image, int colorCount) {

    int transpIndex = -1;

    for (int i = 0; i < image.ExtensionBlockCount; ++i) {

        const ExtensionBlock* eb = image.ExtensionBlocks + i;

        if (eb->Function == 0xF9 && eb->ByteCount == 4) {

            if (eb->Bytes[0] & 1) {

                transpIndex = (unsigned char)eb->Bytes[3];

                // check for valid transpIndex

                if (transpIndex >= colorCount) {

                    transpIndex = -1;

                }

                break;

            }

        }

    }

    return transpIndex;

}



static bool error_return(GifFileType* gif, const SkBitmap& bm,

                         const char msg[]) {

#if 0

    SkDebugf("libgif error <%s> bitmap [%d %d] pixels %p colortable %p\n",

             msg, bm.width(), bm.height(), bm.getPixels(), bm.getColorTable());

#endif

    return false;

}



bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {

    GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc);

    if (NULL == gif) {

        return error_return(gif, *bm, "DGifOpen");

    }



    SkAutoTCallIProc<GifFileType, DGifCloseFile> acp(gif);



    SavedImage temp_save;

    temp_save.ExtensionBlocks=NULL;

    temp_save.ExtensionBlockCount=0;

    SkAutoTCallVProc<SavedImage, CheckFreeExtension> acp2(&temp_save);



    int width, height;

    GifRecordType recType;

    GifByteType *extData;

    int transpIndex = -1;   // -1 means we don't have it (yet)

    

    do {

        if (DGifGetRecordType(gif, &recType) == GIF_ERROR) {

            return error_return(gif, *bm, "DGifGetRecordType");

        }

        

        switch (recType) {

        case IMAGE_DESC_RECORD_TYPE: {

            if (DGifGetImageDesc(gif) == GIF_ERROR) {

                return error_return(gif, *bm, "IMAGE_DESC_RECORD_TYPE");

            }

            

            if (gif->ImageCount < 1) {    // sanity check

                return error_return(gif, *bm, "ImageCount < 1");

            }

                

            width = gif->SWidth;

            height = gif->SHeight;

            if (width <= 0 || height <= 0 ||

                !this->chooseFromOneChoice(SkBitmap::kIndex8_Config,

                                           width, height)) {

                return error_return(gif, *bm, "chooseFromOneChoice");

            }

            

            bm->setConfig(SkBitmap::kIndex8_Config, width, height);

            if (SkImageDecoder::kDecodeBounds_Mode == mode)

                return true;



            SavedImage* image = &gif->SavedImages[gif->ImageCount-1];

            const GifImageDesc& desc = image->ImageDesc;

            

            // check for valid descriptor

            if (   (desc.Top | desc.Left) < 0 ||

                    desc.Left + desc.Width > width ||

                    desc.Top + desc.Height > height) {

                return error_return(gif, *bm, "TopLeft");

            }

            

            // now we decode the colortable

            int colorCount = 0;

            {

                const ColorMapObject* cmap = find_colormap(gif);

                if (NULL == cmap) {

                    return error_return(gif, *bm, "null cmap");

                }



                colorCount = cmap->ColorCount;

                SkColorTable* ctable = SkNEW_ARGS(SkColorTable, (colorCount));

                SkPMColor* colorPtr = ctable->lockColors();

                for (int index = 0; index < colorCount; index++)

                    colorPtr[index] = SkPackARGB32(0xFF,

                                                   cmap->Colors[index].Red, 

                                                   cmap->Colors[index].Green,

                                                   cmap->Colors[index].Blue);



                transpIndex = find_transpIndex(temp_save, colorCount);

                if (transpIndex < 0)

                    ctable->setFlags(ctable->getFlags() | SkColorTable::kColorsAreOpaque_Flag);

                else

                    colorPtr[transpIndex] = 0; // ram in a transparent SkPMColor

                ctable->unlockColors(true);



                SkAutoUnref aurts(ctable);

                if (!this->allocPixelRef(bm, ctable)) {

                    return error_return(gif, *bm, "allocPixelRef");

                }

            }

            

            SkAutoLockPixels alp(*bm);



            // time to decode the scanlines

            //

            uint8_t*  scanline = bm->getAddr8(0, 0);

            const int rowBytes = bm->rowBytes();

            const int innerWidth = desc.Width;

            const int innerHeight = desc.Height;



            // abort if either inner dimension is <= 0

            if (innerWidth <= 0 || innerHeight <= 0) {

                return error_return(gif, *bm, "non-pos inner width/height");

            }



            // are we only a subset of the total bounds?

            if ((desc.Top | desc.Left) > 0 ||

                 innerWidth < width || innerHeight < height)

            {

                int fill;

                if (transpIndex >= 0) {

                    fill = transpIndex;

                } else {

                    fill = gif->SBackGroundColor;

                }

                // check for valid fill index/color

                if (static_cast<unsigned>(fill) >=

                        static_cast<unsigned>(colorCount)) {

                    fill = 0;

                }

                memset(scanline, fill, bm->getSize());

                // bump our starting address

                scanline += desc.Top * rowBytes + desc.Left;

            }

            

            // now decode each scanline

            if (gif->Image.Interlace)

            {

                GifInterlaceIter iter(innerHeight);

                for (int y = 0; y < innerHeight; y++)

                {

                    uint8_t* row = scanline + iter.currY() * rowBytes;

                    if (DGifGetLine(gif, row, innerWidth) == GIF_ERROR) {

                        return error_return(gif, *bm, "interlace DGifGetLine");

                    }

                    iter.next();

                }

            }

            else

            {

                // easy, non-interlace case

                for (int y = 0; y < innerHeight; y++) {

                    if (DGifGetLine(gif, scanline, innerWidth) == GIF_ERROR) {

                        return error_return(gif, *bm, "DGifGetLine");

                    }

                    scanline += rowBytes;

                }

            }

            goto DONE;

            } break;

            

        case EXTENSION_RECORD_TYPE:

            if (DGifGetExtension(gif, &temp_save.Function,

                                 &extData) == GIF_ERROR) {

                return error_return(gif, *bm, "DGifGetExtension");

            }



            while (extData != NULL) {

                /* Create an extension block with our data */

                if (AddExtensionBlock(&temp_save, extData[0],

                                      &extData[1]) == GIF_ERROR) {

                    return error_return(gif, *bm, "AddExtensionBlock");

                }

                if (DGifGetExtensionNext(gif, &extData) == GIF_ERROR) {

                    return error_return(gif, *bm, "DGifGetExtensionNext");

                }

                temp_save.Function = 0;

            }

            break;

            

        case TERMINATE_RECORD_TYPE:

            break;

            

        default:    /* Should be trapped by DGifGetRecordType */

            break;

        }

    } while (recType != TERMINATE_RECORD_TYPE);



DONE:

    return true;

}



///////////////////////////////////////////////////////////////////////////////



#include "SkTRegistry.h"





static SkImageDecoder* Factory(SkStream* stream) {

    char buf[GIF_STAMP_LEN];

    if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) {

        if (memcmp(GIF_STAMP,   buf, GIF_STAMP_LEN) == 0 ||

                memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 ||

                memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) {

            return SkNEW(SkGIFImageDecoder);

        }

    }

    return NULL;

}



#ifdef SK_ENABLE_LIBGIF

    SkImageDecoder* sk_libgif_dfactory(SkStream*);

#endif



SkImageDecoder* sk_libgif_dfactory(SkStream* stream) {

    char buf[GIF_STAMP_LEN];

    if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) {

        if (memcmp(GIF_STAMP,   buf, GIF_STAMP_LEN) == 0 ||

                memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 ||

                memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) {

            return SkNEW(SkGIFImageDecoder);

        }

    }

    return NULL;

}



static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_libgif_dfactory);

SkImageDecoder_libjpeg.cpp(略)

SkImageDecoder_libpng.cpp(略)

然后再skia的android.mk文件中增加:

LOCAL_CFLAGS += -DSK_ENABLE_LIBPNG
LOCAL_CFLAGS += -DSK_ENABLE_LIBJPEG
LOCAL_CFLAGS += -DSK_ENABLE_LIBGIF

 

之前skia的android.mk文件中还增加了

LOCAL_CFLAGS += -DHAVE_PTHREADS
LOCAL_CFLAGS += -DHAVE_ENDIAN_H

android.mk也贴出来吧:

android.mk
BASE_PATH := $(call my-dir)

LOCAL_PATH:= $(call my-dir)



#############################################################

#   build the skia+fretype+png+jpeg+zlib+gif+webp library

#



include $(CLEAR_VARS)



LOCAL_ARM_MODE := arm



MY_ANDROID_SRC := D:/Android2.2/mywork

MY_ANDROID_SRC_4_0 := E:/GameEngineer/OpenSource_code/androidcode4.0

MY_LOCAL_NDKINCLUDE=D:/android-ndk-r8/platforms/android-8/arch-arm/usr/include/

MY_LOCAL_SYSLIB=D:/android-ndk-r8/platforms/android-8/arch-arm/usr/lib/

# need a flag to tell the C side when we're on devices with large memory

# budgets (i.e. larger than the low-end devices that initially shipped)

ifeq ($(ARCH_ARM_HAVE_VFP),true)

    LOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE

endif



ifneq ($(ARCH_ARM_HAVE_VFP),true)

    LOCAL_CFLAGS += -DSK_SOFTWARE_FLOAT

endif



ifeq ($(ARCH_ARM_HAVE_NEON),true)

    LOCAL_CFLAGS += -D__ARM_HAVE_NEON

endif



LOCAL_SRC_FILES:= \

    src/core/Sk64.cpp \

    src/core/SkBuffer.cpp \

    src/core/SkChunkAlloc.cpp \

    src/core/SkCordic.cpp \

    src/core/SkDebug.cpp \

    src/core/SkFloatBits.cpp \

    src/core/SkFontHost.cpp \

    src/core/SkPoint.cpp \

    src/core/SkRect.cpp \

    src/core/SkRegion.cpp \

    src/core/SkString.cpp \

    src/core/SkUtils.cpp \

    src/core/SkFlate.cpp \

    src/core/SkMallocPixelRef.cpp \

    src/core/SkRegion_rects.cpp \

    src/core/SkScalar.cpp \

    src/ports/SkDebug_android.cpp \

    src/effects/Sk1DPathEffect.cpp \

    src/effects/Sk2DPathEffect.cpp \

    src/effects/SkAvoidXfermode.cpp \

    src/effects/SkBitmapCache.cpp \

    src/effects/SkBlurDrawLooper.cpp \

    src/effects/SkBlurMask.cpp \

    src/effects/SkBlurMaskFilter.cpp \

    src/effects/SkColorFilters.cpp \

    src/effects/SkColorMatrixFilter.cpp \

    src/effects/SkCornerPathEffect.cpp \

    src/effects/SkDashPathEffect.cpp \

    src/effects/SkDiscretePathEffect.cpp \

    src/effects/SkEmbossMask.cpp \

    src/effects/SkEmbossMaskFilter.cpp \

    src/effects/SkGradientShader.cpp \

    src/effects/SkGroupShape.cpp \

    src/effects/SkLayerDrawLooper.cpp \

    src/effects/SkLayerRasterizer.cpp \

    src/effects/SkPaintFlagsDrawFilter.cpp \

    src/effects/SkPixelXorXfermode.cpp \

    src/effects/SkPorterDuff.cpp \

    src/effects/SkRectShape.cpp \

    src/effects/SkTableMaskFilter.cpp \

    src/effects/SkTransparentShader.cpp \

    src/images/bmpdecoderhelper.cpp \

    src/images/SkFDStream.cpp \

    src/images/SkFlipPixelRef.cpp \

    src/images/SkImageDecoder.cpp \

    src/images/SkImageDecoder_libbmp.cpp \

    src/images/SkImageDecoder_libgif.cpp \

    src/images/SkImageDecoder_libjpeg.cpp \

    src/images/SkImageDecoder_libpng.cpp \

    src/images/SkImageDecoder_libwebp.cpp \

    src/images/SkImageDecoder_libico.cpp \

    src/images/SkImageDecoder_wbmp.cpp \

    src/images/SkImageEncoder.cpp \

    src/images/SkImageRef.cpp \

    src/images/SkImageRef_GlobalPool.cpp \

    src/images/SkImageRefPool.cpp \

    src/images/SkJpegUtility.cpp \

    src/images/SkBitmapRegionDecoder.cpp \

    src/images/SkMovie.cpp \

    src/images/SkMovie_gif.cpp \

    src/images/SkPageFlipper.cpp \

    src/images/SkScaledBitmapSampler.cpp \

    src/images/SkCreateRLEPixelRef.cpp \

    src/images/SkImageDecoder_Factory.cpp \

    src/images/SkImageEncoder_Factory.cpp \

    src/ports/FontHostConfiguration_android.cpp \

    src/ports/SkFontHost_android.cpp \

    src/ports/SkFontHost_gamma.cpp \

    src/ports/SkFontHost_FreeType.cpp \

    src/ports/SkFontHost_tables.cpp \

    src/ports/SkGlobals_global.cpp \

    src/ports/SkImageRef_ashmem.cpp \

    src/ports/SkOSFile_stdio.cpp \

    src/ports/SkTime_Unix.cpp \

    src/core/SkAlphaRuns.cpp \

    src/core/SkBitmap.cpp \

    src/core/SkBitmap_scroll.cpp \

    src/core/SkBitmapProcShader.cpp \

    src/core/SkBitmapProcState.cpp \

    src/core/SkBitmapProcState_matrixProcs.cpp \

    src/core/SkBitmapSampler.cpp \

    src/core/SkBlitRow_D16.cpp \

    src/core/SkBlitRow_D32.cpp \

    src/core/SkBlitRow_D4444.cpp \

    src/core/SkBlitter.cpp \

    src/core/SkBlitter_4444.cpp \

    src/core/SkBlitter_A1.cpp \

    src/core/SkBlitter_A8.cpp \

    src/core/SkBlitter_ARGB32.cpp \

    src/core/SkBlitter_RGB16.cpp \

    src/core/SkBlitter_Sprite.cpp \

    src/core/SkCanvas.cpp \

    src/core/SkClampRange.cpp \

    src/core/SkClipStack.cpp \

    src/core/SkColor.cpp \

    src/core/SkColorFilter.cpp \

    src/core/SkColorTable.cpp \

    src/core/SkComposeShader.cpp \

    src/core/SkCubicClipper.cpp \

    src/core/SkDeque.cpp \

    src/core/SkDevice.cpp \

    src/core/SkDither.cpp \

    src/core/SkDraw.cpp \

    src/core/SkEdge.cpp \

    src/core/SkEdgeBuilder.cpp \

    src/core/SkEdgeClipper.cpp \

    src/core/SkFilterProc.cpp \

    src/core/SkFlattenable.cpp \

    src/core/SkGeometry.cpp \

    src/core/SkGlobals.cpp \

    src/core/SkGlyphCache.cpp \

    src/core/SkGraphics.cpp \

    src/core/SkLineClipper.cpp \

    src/core/SkMMapStream.cpp \

    src/core/SkMask.cpp \

    src/core/SkMaskFilter.cpp \

    src/core/SkMath.cpp \

    src/core/SkMatrix.cpp \

    src/core/SkMemory_stdlib.cpp \

    src/core/SkMetaData.cpp \

    src/core/SkPackBits.cpp \

    src/core/SkPaint.cpp \

    src/core/SkPath.cpp \

    src/core/SkPathEffect.cpp \

    src/core/SkPathHeap.cpp \

    src/core/SkPathMeasure.cpp \

    src/core/SkPicture.cpp \

    src/core/SkPictureFlat.cpp \

    src/core/SkPicturePlayback.cpp \

    src/core/SkPictureRecord.cpp \

    src/core/SkPixelRef.cpp \

    src/core/SkProcSpriteBlitter.cpp \

    src/core/SkPtrRecorder.cpp \

    src/core/SkQuadClipper.cpp \

    src/core/SkRasterizer.cpp \

    src/core/SkRefDict.cpp \

    src/core/SkRegion_path.cpp \

    src/core/SkScalerContext.cpp \

    src/core/SkScan.cpp \

    src/core/SkScan_AntiPath.cpp \

    src/core/SkScan_Antihair.cpp \

    src/core/SkScan_Hairline.cpp \

    src/core/SkScan_Path.cpp \

    src/core/SkShader.cpp \

    src/core/SkShape.cpp \

    src/core/SkSpriteBlitter_ARGB32.cpp \

    src/core/SkSpriteBlitter_RGB16.cpp \

    src/core/SkStream.cpp \

    src/core/SkStroke.cpp \

    src/core/SkStrokerPriv.cpp \

    src/core/SkTSearch.cpp \

    src/core/SkTypeface.cpp \

    src/core/SkTypefaceCache.cpp \

    src/core/SkUnPreMultiply.cpp \

    src/core/SkXfermode.cpp \

    src/core/SkWriter32.cpp \

    src/utils/SkBoundaryPatch.cpp \

    src/utils/SkCamera.cpp \

    src/utils/SkDumpCanvas.cpp \

    src/utils/SkEGLContext_none.cpp \

    src/utils/SkInterpolator.cpp \

    src/utils/SkLayer.cpp \

    src/utils/SkOSFile.cpp \

    src/utils/SkMeshUtils.cpp \

    src/utils/SkNinePatch.cpp \

    src/utils/SkParse.cpp \

    src/utils/SkParsePath.cpp \

    src/utils/SkProxyCanvas.cpp \

    src/utils/SkUnitMappers.cpp



ifeq ($(TARGET_ARCH),arm)



ifeq ($(ARCH_ARM_HAVE_NEON),true)

LOCAL_SRC_FILES += \

    src/opts/memset16_neon.S \

    src/opts/memset32_neon.S

endif



LOCAL_SRC_FILES += \

    src/opts/SkBlitRow_opts_arm.cpp \

    src/opts/SkBitmapProcState_opts_arm.cpp \

    src/opts/opts_check_arm.cpp \

    src/opts/memset.arm.S

else

LOCAL_SRC_FILES += \

    src/opts/SkBlitRow_opts_none.cpp \

    src/opts/SkBitmapProcState_opts_none.cpp

endif



# these are for emoji support, needed by webkit

LOCAL_SRC_FILES += \

    emoji/EmojiFont.cpp



#LOCAL_SHARED_LIBRARIES := \

#    libjpeg

    

#    $(LOCAL_PATH)/lib/libcutils \

#    $(LOCAL_PATH)/lib/libemoji \

#    $(LOCAL_PATH)/lib/libutils \

#    $(LOCAL_PATH)/lib/libz \



LOCAL_STATIC_LIBRARIES := \

  zy_ft2 \

      libpng \

      libjpeg \

      libgif \

    libwebp-decode \

    libwebp-encode





#    $(LOCAL_PATH)/lib/libgif \



LOCAL_LDLIBS := -lcutils -lemoji -lutils -lz

# -ljpeg -lpng -lwebp-decode -lwebp-encode -lft2 -lgif



LOCAL_C_INCLUDES += \

    $(LOCAL_PATH)/src/core \

    $(LOCAL_PATH)/include/core \

    $(LOCAL_PATH)/include/effects \

    $(LOCAL_PATH)/include/images \

    $(LOCAL_PATH)/include/utils \

    $(LOCAL_PATH)/include/xml \

    $(LOCAL_PATH)/include \

    $(MY_LOCAL_NDKINCLUDE)/libexpat \

    $(MY_ANDROID_SRC)/external/freetype/include \

    $(MY_ANDROID_SRC)/external/freetype/include/freetype \

    $(MY_ANDROID_SRC)/external/zlib \

    $(MY_ANDROID_SRC_4_0)/external/libpng \

    $(MY_ANDROID_SRC_4_0)/external/giflib \

    $(MY_ANDROID_SRC_4_0)/external/jpeg \

    $(LOCAL_PATH)/../webp/include \

    $(MY_ANDROID_SRC)/frameworks/opt/emoji \

    $(MY_ANDROID_SRC)/external/expat/lib \

    $(MY_ANDROID_SRC)/external/expat/amiga/include \

    $(MY_ANDROID_SRC)/external/expat/amiga/include/inline4 \

  $(MY_ANDROID_SRC)/system/core/include \

  $(MY_ANDROID_SRC)/frameworks\base\include



ifeq ($(NO_FALLBACK_FONT),true)

    LOCAL_CFLAGS += -DNO_FALLBACK_FONT

endif



LOCAL_CFLAGS += -DHAVE_PTHREADS

LOCAL_CFLAGS += -DHAVE_ENDIAN_H

LOCAL_CFLAGS += -DSK_ENABLE_LIBPNG

LOCAL_CFLAGS += -DSK_ENABLE_LIBJPEG

LOCAL_CFLAGS += -DSK_ENABLE_LIBGIF

LOCAL_CFLAGS += -O0

LOCAL_LDLIBS += -lpthread



LOCAL_MODULE := zyskia

#LOCAL_MODULE_FILENAME := libskia



include $(BUILD_STATIC_LIBRARY)



$(call import-module,zyadapt/webp)

$(call import-module,zyadapt/freetype)

$(call import-module,zyadapt/libpng)

$(call import-module,zyadapt/jpeg)

$(call import-module,zyadapt/giflib)

你可能感兴趣的:(android)