Initial GYP file for skia / gr. Builds SampleApp on Mac, Windows, Linux.

Review URL: http://codereview.appspot.com/4282056/

git-svn-id: http://skia.googlecode.com/svn/trunk@955 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/skia.gyp b/gyp/skia.gyp
new file mode 100644
index 0000000..fec90a8
--- /dev/null
+++ b/gyp/skia.gyp
@@ -0,0 +1,1430 @@
+{

+  'target_defaults': {

+   'msvs_settings': {

+      #really need to figure out how to generate debug and release

+      'VCLinkerTool': {

+        'GenerateDebugInformation': 'true',

+      },

+      'VCCLCompilerTool': {

+          'DebugInformationFormat': '4',

+          'Optimization': '0',

+      },

+    },

+    'conditions': [

+      [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {

+        'include_dirs' : [

+          '/usr/include/freetype2',

+        ],

+      }],

+      [ 'OS == "mac"', {

+        'defines': [

+          'SK_BUILD_FOR_MAC',

+        ],

+      }],

+      [ 'OS == "win"', {

+        'defines': [

+          'SK_BUILD_FOR_WIN32',

+        ],

+      },],

+    ],

+    'direct_dependent_settings': {

+      'conditions': [

+        [ 'OS == "mac"', {

+          'defines': [

+            'SK_BUILD_FOR_MAC',

+          ],

+        }],

+        [ 'OS == "win"', {

+          'defines': [

+            'SK_BUILD_FOR_WIN32',

+          ],

+        },],

+      ],

+    },

+  },

+  'targets': [

+    {

+      'target_name': 'skia',

+      'type': 'static_library',

+      'msvs_guid': 'B7760B5E-BFA8-486B-ACFD-49E3A6DE8E76',

+      'sources': [

+        '../src/core/ARGB32_Clamp_Bilinear_BitmapShader.h',

+        '../src/core/Sk64.cpp',

+        '../src/core/SkAdvancedTypefaceMetrics.cpp',

+        '../src/core/SkAlphaRuns.cpp',

+        '../src/core/SkAntiRun.h',

+        '../src/core/SkBitmap.cpp',

+        '../src/core/SkBitmapProcShader.cpp',

+        '../src/core/SkBitmapProcShader.h',

+        '../src/core/SkBitmapProcState.cpp',

+        '../src/core/SkBitmapProcState.h',

+        '../src/core/SkBitmapProcState_matrix.h',

+        '../src/core/SkBitmapProcState_matrixProcs.cpp',

+        '../src/core/SkBitmapProcState_sample.h',

+        '../src/core/SkBitmapSampler.cpp',

+        '../src/core/SkBitmapSampler.h',

+        '../src/core/SkBitmapSamplerTemplate.h',

+        '../src/core/SkBitmapShader16BilerpTemplate.h',

+        '../src/core/SkBitmapShaderTemplate.h',

+        '../src/core/SkBitmap_scroll.cpp',

+        '../src/core/SkBlitBWMaskTemplate.h',

+        '../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/SkBuffer.cpp',

+        '../src/core/SkCanvas.cpp',

+        '../src/core/SkChunkAlloc.cpp',

+        '../src/core/SkClipStack.cpp',

+        '../src/core/SkColor.cpp',

+        '../src/core/SkColorFilter.cpp',

+        '../src/core/SkColorTable.cpp',

+        '../src/core/SkComposeShader.cpp',

+        '../src/core/SkConcaveToTriangles.cpp',

+        '../src/core/SkConcaveToTriangles.h',

+        '../src/core/SkCordic.cpp',

+        '../src/core/SkCordic.h',

+        '../src/core/SkCoreBlitters.h',

+        '../src/core/SkCubicClipper.cpp',

+        '../src/core/SkCubicClipper.h',

+        '../src/core/SkDebug.cpp',

+        '../src/core/SkDeque.cpp',

+        '../src/core/SkDevice.cpp',

+        '../src/core/SkDither.cpp',

+        '../src/core/SkDraw.cpp',

+        '../src/core/SkDrawProcs.h',

+        '../src/core/SkEdgeBuilder.cpp',

+        '../src/core/SkEdgeClipper.cpp',

+        '../src/core/SkEdge.cpp',

+        '../src/core/SkEdge.h',

+        '../src/core/SkFP.h',

+        '../src/core/SkFilterProc.cpp',

+        '../src/core/SkFilterProc.h',

+        '../src/core/SkFlattenable.cpp',

+        '../src/core/SkFloat.cpp',

+        '../src/core/SkFloat.h',

+        '../src/core/SkFloatBits.cpp',

+        '../src/core/SkGeometry.cpp',

+        '../src/core/SkGlobals.cpp',

+        '../src/core/SkGlyphCache.cpp',

+        '../src/core/SkGlyphCache.h',

+        '../src/core/SkGraphics.cpp',

+        '../src/core/SkLineClipper.cpp',

+        '../src/core/SkMallocPixelRef.cpp',

+        '../src/core/SkMask.cpp',

+        '../src/core/SkMaskFilter.cpp',

+        '../src/core/SkMath.cpp',

+        '../src/core/SkMatrix.cpp',

+        '../src/core/SkPackBits.cpp',

+        '../src/core/SkPaint.cpp',

+        '../src/core/SkPath.cpp',

+        '../src/core/SkPathEffect.cpp',

+        '../src/core/SkPathHeap.cpp',

+        '../src/core/SkPathHeap.h',

+        '../src/core/SkPathMeasure.cpp',

+        '../src/core/SkPicture.cpp',

+        '../src/core/SkPictureFlat.cpp',

+        '../src/core/SkPictureFlat.h',

+        '../src/core/SkPicturePlayback.cpp',

+        '../src/core/SkPicturePlayback.h',

+        '../src/core/SkPictureRecord.cpp',

+        '../src/core/SkPictureRecord.h',

+        '../src/core/SkPixelRef.cpp',

+        '../src/core/SkPoint.cpp',

+        '../src/core/SkProcSpriteBlitter.cpp',

+        '../src/core/SkPtrRecorder.cpp',

+        '../src/core/SkQuadClipper.cpp',

+        '../src/core/SkQuadClipper.h',

+        '../src/core/SkRasterizer.cpp',

+        '../src/core/SkRect.cpp',

+        '../src/core/SkRefDict.cpp',

+        '../src/core/SkRegion.cpp',

+        '../src/core/SkRegionPriv.h',

+        '../src/core/SkRegion_path.cpp',

+        '../src/core/SkScalar.cpp',

+        '../src/core/SkScalerContext.cpp',

+        '../src/core/SkScan.cpp',

+        '../src/core/SkScanPriv.h',

+        '../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/SkSinTable.h',

+        '../src/core/SkSpriteBlitter.h',

+        '../src/core/SkSpriteBlitterTemplate.h',

+        '../src/core/SkStream.cpp',

+        '../src/core/SkString.cpp',

+        '../src/core/SkStroke.cpp',

+        '../src/core/SkStrokerPriv.cpp',

+        '../src/core/SkStrokerPriv.h',

+        '../src/core/SkTextFormatParams.h',

+        '../src/core/SkTSearch.cpp',

+        '../src/core/SkTSort.h',

+        '../src/core/SkTemplatesPriv.h',

+        '../src/core/SkTypeface.cpp',

+        '../src/core/SkUnPreMultiply.cpp',

+        '../src/core/SkUtils.cpp',

+        '../src/core/SkWriter32.cpp',

+        '../src/core/SkXfermode.cpp',

+

+        '../src/opts/opts_check_SSE2.cpp',

+

+        '../src/ports/SkDebug_stdio.cpp',

+        '../src/ports/SkFontHost_tables.cpp',

+        '../src/ports/SkGlobals_global.cpp',

+        '../src/ports/SkMemory_malloc.cpp',

+        '../src/ports/SkOSFile_stdio.cpp',

+        '../src/ports/SkTime_Unix.cpp',

+        '../src/ports/SkXMLParser_empty.cpp',

+        '../src/ports/sk_predefined_gamma.h',

+

+        '../include/core/Sk64.h',

+        '../include/core/SkAdvancedTypefaceMetrics.h',

+        '../include/core/SkAutoKern.h',

+        '../include/core/SkBitmap.h',

+        '../include/core/SkBlitRow.h',

+        '../include/core/SkBlitter.h',

+        '../include/core/SkBounder.h',

+        '../include/core/SkBuffer.h',

+        '../include/core/SkCanvas.h',

+        '../include/core/SkChunkAlloc.h',

+        '../include/core/SkClipStack.h',

+        '../include/core/SkColor.h',

+        '../include/core/SkColorFilter.h',

+        '../include/core/SkColorPriv.h',

+        '../include/core/SkColorShader.h',

+        '../include/core/SkComposeShader.h',

+        '../include/core/SkDeque.h',

+        '../include/core/SkDescriptor.h',

+        '../include/core/SkDevice.h',

+        '../include/core/SkDither.h',

+        '../include/core/SkDraw.h',

+        '../include/core/SkDrawFilter.h',

+        '../include/core/SkDrawLooper.h',

+        '../include/core/SkEndian.h',

+        '../include/core/SkFDot6.h',

+        '../include/core/SkFixed.h',

+        '../include/core/SkFlattenable.h',

+        '../include/core/SkFloatBits.h',

+        '../include/core/SkFloatingPoint.h',

+        '../include/core/SkFontHost.h',

+        '../include/core/SkGeometry.h',

+        '../include/core/SkGlobals.h',

+        '../include/core/SkGraphics.h',

+        '../include/core/SkMallocPixelRef.h',

+        '../include/core/SkMask.h',

+        '../include/core/SkMaskFilter.h',

+        '../include/core/SkMath.h',

+        '../include/core/SkMatrix.h',

+        '../include/core/SkOSFile.h',

+        '../include/core/SkPackBits.h',

+        '../include/core/SkPaint.h',

+        '../include/core/SkPath.h',

+        '../include/core/SkPathEffect.h',

+        '../include/core/SkPathMeasure.h',

+        '../include/core/SkPerspIter.h',

+        '../include/core/SkPicture.h',

+        '../include/core/SkPixelRef.h',

+        '../include/core/SkPoint.h',

+        '../include/core/SkPtrRecorder.h',

+        '../include/core/SkRandom.h',

+        '../include/core/SkRasterizer.h',

+        '../include/core/SkReader32.h',

+        '../include/core/SkRect.h',

+        '../include/core/SkRefCnt.h',

+        '../include/core/SkRefDict.h',

+        '../include/core/SkRegion.h',

+        '../include/core/SkScalar.h',

+        '../include/core/SkScalarCompare.h',

+        '../include/core/SkScalerContext.h',

+        '../include/core/SkScan.h',

+        '../include/core/SkShader.h',

+        '../include/core/SkStream.h',

+        '../include/core/SkString.h',

+        '../include/core/SkStroke.h',

+        '../include/core/SkTDArray.h',

+        '../include/core/SkTDStack.h',

+        '../include/core/SkTDict.h',

+        '../include/core/SkTRegistry.h',

+        '../include/core/SkTScopedPtr.h',

+        '../include/core/SkTSearch.h',

+        '../include/core/SkTemplates.h',

+        '../include/core/SkThread.h',

+        '../include/core/SkThread_platform.h',

+        '../include/core/SkTime.h',

+        '../include/core/SkTypeface.h',

+        '../include/core/SkTypes.h',

+        '../include/core/SkUnPreMultiply.h',

+        '../include/core/SkUnitMapper.h',

+        '../include/core/SkUtils.h',

+        '../include/core/SkWriter32.h',

+        '../include/core/SkXfermode.h',

+      ],

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/ports',

+        '../include/xml',

+        '../src/core',

+      ],

+      'msvs_disabled_warnings': [4244, 4267,4345, 4390, 4554, 4800],

+      'conditions': [

+        [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {

+          'cflags': [

+            '-Wno-unused',

+            '-Wno-unused-function',

+          ],

+          'sources': [

+            '../include/core/SkMMapStream.h',

+            '../src/core/SkMMapStream.cpp',

+            '../src/core/SkBlitter_ARGB32_Subpixel.cpp',

+            '../src/core/SkFontHost.cpp',

+            '../src/ports/SkThread_pthread.cpp',

+            '../src/ports/SkTime_Unix.cpp',

+            '../src/ports/SkFontHost_FreeType_Subpixel.cpp',

+            '../src/ports/SkFontHost_FreeType.cpp',

+            '../src/ports/SkFontHost_gamma_none.cpp',

+            '../src/ports/SkFontHost_linux.cpp',

+          ],

+          'link_settings': {

+            'libraries': [

+              '-lfreetype',

+            ],

+          },  

+        }],

+        [ 'OS == "mac"', {

+          'include_dirs': [

+            '../include/utils/mac',

+          ],

+          'sources': [

+            '../include/core/SkMMapStream.h',

+            '../include/utils/mac/SkCGUtils.h',

+

+            '../src/core/SkMMapStream.cpp',

+            '../src/ports/SkFontHost_mac_coretext.cpp',

+

+            '../src/ports/SkThread_pthread.cpp',

+            '../src/ports/SkTime_Unix.cpp',

+

+            '../src/utils/mac/SkCreateCGImageRef.cpp',

+          ],

+        }],

+        [ 'OS == "win"', {

+          'include_dirs': [

+            'config/win',

+          ],

+          'sources': [

+            '../src/ports/SkFontHost_win.cpp',

+            '../src/ports/SkThread_win.cpp',

+          ],

+        },],

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          'config',

+          '../include/config',

+          '../include/core',

+          'ext',

+        ],

+      },

+      'dependencies': [

+        'skia_opts'

+      ],

+    },

+

+    # Due to an unfortunate intersection of lameness between gcc and gyp,

+    # we have to build the *_SSE2.cpp files in a separate target.  The

+    # gcc lameness is that, in order to compile SSE2 intrinsics code, it

+    # must be passed the -msse2 flag.  However, with this flag, it may

+    # emit SSE2 instructions even for scalar code, such as the CPUID

+    # test used to test for the presence of SSE2.  So that, and all other

+    # code must be compiled *without* -msse2.  The gyp lameness is that it

+    # does not allow file-specific CFLAGS, so we must create this extra

+    # target for those files to be compiled with -msse2.

+    #

+    # This is actually only a problem on 32-bit Linux (all Intel Macs have

+    # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit

+    # SSE2 from instrinsics, while generating plain ol' 386 for everything

+    # else).  However, to keep the .gyp file simple and avoid platform-specific

+    # build breakage, we do this on all platforms.

+

+    # For about the same reason, we need to compile the ARM opts files

+    # separately as well.

+    {

+      'target_name': 'skia_opts',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../src/core',

+      ],

+      'conditions': [

+        [ '(OS == "linux" or OS == "freebsd" or OS == "openbsd")', {

+          'cflags': [

+            '-msse2',

+          ],

+        }],

+      ],

+      'sources': [

+        '../src/opts/SkBitmapProcState_opts_SSE2.cpp',

+        '../src/opts/SkBlitRow_opts_SSE2.cpp',

+        '../src/opts/SkUtils_opts_SSE2.cpp',

+      ],

+    },

+    {

+      'target_name': 'effects',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/effects',

+      ],

+      'sources': [

+        '../include/effects/Sk1DPathEffect.h',

+        '../include/effects/Sk2DPathEffect.h',

+        '../include/effects/SkAvoidXfermode.h',

+        '../include/effects/SkBlurDrawLooper.h',

+        '../include/effects/SkBlurMaskFilter.h',

+        '../include/effects/SkColorMatrix.h',

+        '../include/effects/SkColorMatrixFilter.h',

+        '../include/effects/SkCornerPathEffect.h',

+        '../include/effects/SkDashPathEffect.h',

+        '../include/effects/SkDiscretePathEffect.h',

+        '../include/effects/SkDrawExtraPathEffect.h',

+        '../include/effects/SkEmbossMaskFilter.h',

+        '../include/effects/SkGradientShader.h',

+        '../include/effects/SkGroupShape.h',

+        '../include/effects/SkKernel33MaskFilter.h',

+        '../include/effects/SkLayerDrawLooper.h',

+        '../include/effects/SkLayerRasterizer.h',

+        '../include/effects/SkPaintFlagsDrawFilter.h',

+        '../include/effects/SkPixelXorXfermode.h',

+        '../include/effects/SkPorterDuff.h',

+        '../include/effects/SkRectShape.h',

+        '../include/effects/SkTableMaskFilter.h',

+        '../include/effects/SkTransparentShader.h',

+

+        '../src/effects/Sk1DPathEffect.cpp',

+        '../src/effects/Sk2DPathEffect.cpp',

+        '../src/effects/SkAvoidXfermode.cpp',

+        '../src/effects/SkBitmapCache.cpp',

+        '../src/effects/SkBitmapCache.h',

+        '../src/effects/SkBlurDrawLooper.cpp',

+        '../src/effects/SkBlurMask.cpp',

+        '../src/effects/SkBlurMask.h',

+        '../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/SkEmbossMask.h',

+        '../src/effects/SkEmbossMask_Table.h',

+        '../src/effects/SkEmbossMaskFilter.cpp',

+        '../src/effects/SkGradientShader.cpp',

+        '../src/effects/SkGroupShape.cpp',

+        '../src/effects/SkKernel33MaskFilter.cpp',

+        '../src/effects/SkLayerDrawLooper.cpp',

+        '../src/effects/SkLayerRasterizer.cpp',

+        '../src/effects/SkPaintFlagsDrawFilter.cpp',

+        '../src/effects/SkPixelXorXfermode.cpp',

+        '../src/effects/SkPorterDuff.cpp',

+        '../src/effects/SkRadialGradient_Table.h',

+        '../src/effects/SkRectShape.cpp',

+        '../src/effects/SkTableMaskFilter.cpp',

+        '../src/effects/SkTransparentShader.cpp',

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/effects',

+        ],

+      },

+    },

+    {

+      'target_name': 'images',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/images',

+      ],

+      'sources': [

+        '../include/images/SkFlipPixelRef.h',

+        '../include/images/SkImageDecoder.h',

+        '../include/images/SkImageEncoder.h',

+        '../include/images/SkImageRef.h',

+        '../include/images/SkImageRef_GlobalPool.h',

+        '../include/images/SkJpegUtility.h',

+        '../include/images/SkMovie.h',

+        '../include/images/SkPageFlipper.h',

+

+        '../src/images/bmpdecoderhelper.cpp',

+        '../src/images/bmpdecoderhelper.h',

+        '../src/images/SkBitmap_RLEPixels.h',

+        '../src/images/SkCreateRLEPixelRef.cpp',

+        '../src/images/SkFDStream.cpp',

+        '../src/images/SkFlipPixelRef.cpp',

+        '../src/images/SkImageDecoder.cpp',

+        '../src/images/SkImageDecoder_Factory.cpp',

+        '../src/images/SkImageDecoder_libbmp.cpp',

+        '../src/images/SkImageDecoder_libgif.cpp',

+        '../src/images/SkImageDecoder_libico.cpp',

+        '../src/images/SkImageDecoder_libjpeg.cpp',

+        '../src/images/SkImageDecoder_libpng.cpp',

+        '../src/images/SkImageDecoder_libpvjpeg.c',

+        '../src/images/SkImageDecoder_wbmp.cpp',

+        '../src/images/SkImageEncoder.cpp',

+        '../src/images/SkImageEncoder_Factory.cpp',

+        '../src/images/SkImageRef.cpp',

+        '../src/images/SkImageRefPool.cpp',

+        '../src/images/SkImageRefPool.h',

+        '../src/images/SkImageRef_GlobalPool.cpp',

+        '../src/images/SkJpegUtility.cpp',

+        '../src/images/SkMovie.cpp',

+        '../src/images/SkMovie_gif.cpp',

+        '../src/images/SkPageFlipper.cpp',

+        '../src/images/SkScaledBitmapSampler.cpp',

+        '../src/images/SkScaledBitmapSampler.h',

+      ],

+      'conditions': [

+        [ 'OS == "win"', {

+          'sources!': [

+            '../include/images/SkJpegUtility.h',

+

+            '../src/images/SkFDStream.cpp',

+            '../src/images/SkImageDecoder_libjpeg.cpp',

+            '../src/images/SkImageDecoder_libpng.cpp',

+            '../src/images/SkImageDecoder_libpvjpeg.c',

+            '../src/images/SkJpegUtility.cpp',

+            '../src/images/SkMovie_gif.cpp',

+          ],

+        },],

+        [ 'OS == "mac"', {

+          'sources!': [

+            '../include/images/SkJpegUtility.h',

+

+            '../src/images/SkImageDecoder_libgif.cpp',

+            '../src/images/SkImageDecoder_libjpeg.cpp',

+            '../src/images/SkImageDecoder_libpng.cpp',

+            '../src/images/SkImageDecoder_libpvjpeg.c',

+            '../src/images/SkJpegUtility.cpp',

+            '../src/images/SkMovie_gif.cpp',

+          ],

+        },],

+        [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {

+          'sources!': [

+            '../include/images/SkJpegUtility.h',

+

+            '../src/images/SkImageDecoder_libjpeg.cpp',

+            '../src/images/SkImageDecoder_libgif.cpp',

+            '../src/images/SkImageDecoder_libpvjpeg.c',

+            '../src/images/SkJpegUtility.cpp',

+            '../src/images/SkMovie_gif.cpp',

+          ],

+        }],

+

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/images',

+        ],

+      },

+    },

+    {

+      'target_name': 'xml',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/xml',

+        '../include/utils',

+      ],

+      'sources': [

+        '../include/xml/SkBML_WXMLParser.h',

+        '../include/xml/SkBML_XMLParser.h',

+        '../include/xml/SkDOM.h',

+        '../include/xml/SkJS.h',

+        '../include/xml/SkXMLParser.h',

+        '../include/xml/SkXMLWriter.h',

+

+        '../src/xml/SkBML_Verbs.h',

+        '../src/xml/SkBML_XMLParser.cpp',

+        '../src/xml/SkDOM.cpp',

+        '../src/xml/SkJS.cpp',

+        '../src/xml/SkJSDisplayable.cpp',

+        '../src/xml/SkXMLParser.cpp',

+        '../src/xml/SkXMLPullParser.cpp',

+        '../src/xml/SkXMLWriter.cpp',

+      ],

+      'sources!': [

+          '../src/xml/SkXMLPullParser.cpp', #if 0 around class decl in header

+      ],

+      'conditions': [

+        [ 'OS == "win" or OS == "mac" or OS == "linux" or OS == "openbsd" or OS == "solaris"', {

+          'sources!': [

+            # no jsapi.h by default on system

+            '../include/xml/SkJS.h',

+            '../src/xml/SkJS.cpp',

+            '../src/xml/SkJSDisplayable.cpp',

+          ],

+        },],

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/xml',

+        ],

+      },

+    },

+    {

+      'target_name': 'utils',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/utils',

+        '../include/views',

+        '../include/effects',

+        '../include/xml',

+      ],

+      'sources': [

+        '../include/utils/SkBoundaryPatch.h',

+        '../include/utils/SkCamera.h',

+        '../include/utils/SkCubicInterval.h',

+        '../include/utils/SkCullPoints.h',

+        '../include/utils/SkDumpCanvas.h',

+        '../include/utils/SkEGLContext.h',

+        '../include/utils/SkGLCanvas.h',

+        '../include/utils/SkInterpolator.h',

+        '../include/utils/SkLayer.h',

+        '../include/utils/SkMeshUtils.h',

+        '../include/utils/SkNinePatch.h',

+        '../include/utils/SkNWayCanvas.h',

+        '../include/utils/SkParse.h',

+        '../include/utils/SkParsePaint.h',

+        '../include/utils/SkParsePath.h',

+        '../include/utils/SkProxyCanvas.h',

+        '../include/utils/SkSfntUtils.h',

+        '../include/utils/SkTextBox.h',

+        '../include/utils/SkUnitMappers.h',

+

+        '../src/utils/SkBoundaryPatch.cpp',

+        '../src/utils/SkCamera.cpp',

+        '../src/utils/SkColorMatrix.cpp',

+        '../src/utils/SkCubicInterval.cpp',

+        '../src/utils/SkCullPoints.cpp',

+        '../src/utils/SkDumpCanvas.cpp',

+        '../src/utils/SkEGLContext_none.cpp',

+        '../src/utils/SkInterpolator.cpp',

+        '../src/utils/SkLayer.cpp',

+        '../src/utils/SkMeshUtils.cpp',

+        '../src/utils/SkNinePatch.cpp',

+        '../src/utils/SkNWayCanvas.cpp',

+        '../src/utils/SkOSFile.cpp',

+        '../src/utils/SkParse.cpp',

+        '../src/utils/SkParseColor.cpp',

+        '../src/utils/SkParsePath.cpp',

+        '../src/utils/SkProxyCanvas.cpp',

+        '../src/utils/SkSfntUtils.cpp',

+        '../src/utils/SkUnitMappers.cpp',

+      ],

+      'conditions': [

+        [ 'OS == "mac"', {

+          'sources': [

+            '../include/utils/SkCGUtils.h',

+            '../src/utils/mac/SkCreateCGImageRef.cpp',

+            '../src/utils/mac/SkEGLContext_mac.cpp',

+          ],

+        },],

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/utils',

+        ],

+      },

+    },

+    {

+      'target_name': 'views',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/views',

+        '../include/xml',

+        '../include/utils',

+        '../include/images',

+        '../include/animator',

+        '../include/effects',

+      ],

+      'sources': [

+        '../include/views/SkApplication.h',

+        '../include/views/SkBGViewArtist.h',

+        '../include/views/SkBorderView.h',

+        '../include/views/SkEvent.h',

+        '../include/views/SkEventSink.h',

+        '../include/views/SkImageView.h',

+        '../include/views/SkKey.h',

+        '../include/views/SkMetaData.h',

+        '../include/views/SkOSMenu.h',

+        '../include/views/SkOSWindow_Mac.h',

+        '../include/views/SkOSWindow_SDL.h',

+        '../include/views/SkOSWindow_Unix.h',

+        '../include/views/SkOSWindow_Win.h',

+        #'../include/views/SkOSWindow_wxwidgets.h',

+        '../include/views/SkProgressBarView.h',

+        '../include/views/SkScrollBarView.h',

+        '../include/views/SkStackViewLayout.h',

+        '../include/views/SkSystemEventTypes.h',

+        '../include/views/SkTouchGesture.h',

+        '../include/views/SkView.h',

+        '../include/views/SkViewInflate.h',

+        '../include/views/SkWidget.h',

+        '../include/views/SkWidgetViews.h',

+        '../include/views/SkWindow.h',

+

+        '../src/views/SkBGViewArtist.cpp',

+        '../src/views/SkBorderView.cpp',

+        '../src/views/SkEvent.cpp',

+        '../src/views/SkEventSink.cpp',

+        '../src/views/SkImageView.cpp',

+        '../src/views/SkListView.cpp',

+        '../src/views/SkListWidget.cpp',

+        '../src/views/SkMetaData.cpp',

+        '../src/views/SkOSMenu.cpp',

+        '../src/views/SkParsePaint.cpp',

+        '../src/views/SkProgressBarView.cpp',

+        '../src/views/SkProgressView.cpp',

+        '../src/views/SkScrollBarView.cpp',

+        '../src/views/SkStackViewLayout.cpp',

+        '../src/views/SkStaticTextView.cpp',

+        '../src/views/SkTagList.cpp',

+        '../src/views/SkTagList.h',

+        '../src/views/SkTextBox.cpp',

+        '../src/views/SkTouchGesture.cpp',

+        '../src/views/SkView.cpp',

+        '../src/views/SkViewInflate.cpp',

+        '../src/views/SkViewPriv.cpp',

+        '../src/views/SkViewPriv.h',

+        '../src/views/SkWidget.cpp',

+        '../src/views/SkWidgets.cpp',

+        '../src/views/SkWidgetViews.cpp',

+        '../src/views/SkWindow.cpp',

+      ],

+      'sources!' : [

+        '../src/views/SkListView.cpp',   #depends on missing SkListSource implementation

+        '../src/views/SkListWidget.cpp', #depends on missing SkListSource implementation

+      ],

+      'conditions': [

+        [ 'OS == "win"', {

+          'sources': [

+            '../src/utils/win/SkOSWindow_Win.cpp',

+            '../vs/SampleApp/skia_win.cpp',

+          ],

+        },],

+        [ 'OS == "mac"', {

+          'sources': [

+            '../include/utils/SkCGUtils.h',

+            #'../src/utils/mac/SkBitmap_Mac.cpp',

+            '../src/utils/mac/SkCreateCGImageRef.cpp',

+            '../src/utils/mac/SkEGLContext_mac.cpp',

+            '../src/utils/mac/skia_mac.cpp',

+            '../src/utils/mac/SkOSWindow_Mac.cpp',

+          ],

+          'link_settings': {

+            'libraries': [

+              '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',

+              '$(SDKROOT)/System/Library/Frameworks/AGL.framework',

+            ],

+          },

+        },],

+        [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {

+          'include_dirs' : [

+            '../include/utils/unix',

+          ],

+          'sources': [

+            '../src/utils/unix/keysym2ucs.c',

+            '../src/utils/unix/SkOSWindow_Unix.cpp',

+            '../unix_test_app/main.cpp',

+          ],

+        }],

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/views',

+        ],

+      },

+    },

+    {

+      'target_name': 'skgr',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../src/core',

+        '../include/gpu',

+        '../gpu/include',

+      ],

+      'sources': [

+        '../include/gpu/SkGpuCanvas.h',

+        '../include/gpu/SkGpuDevice.h',

+        '../include/gpu/SkGpuDeviceFactory.h',

+        '../include/gpu/SkGr.h',

+        '../include/gpu/SkGrTexturePixelRef.h',

+

+        '../src/gpu/GrPrintf_skia.cpp',

+        '../src/gpu/SkGpuCanvas.cpp',

+        '../src/gpu/SkGpuDevice.cpp',

+        '../src/gpu/SkGr.cpp',

+        '../src/gpu/SkGrFontScaler.cpp',

+        '../src/gpu/SkGrTexturePixelRef.cpp',

+      ],

+      'conditions': [

+          [ 'OS == "linux"', {

+          'defines': [

+              'GR_LINUX_BUILD=1',

+          ],

+          }],

+          [ 'OS == "mac"', {

+          'defines': [

+              'GR_MAC_BUILD=1',

+          ],

+          }],

+          [ 'OS == "win"', {

+          'defines': [

+              'GR_WIN32_BUILD=1',

+          ],

+          },],

+      ],

+      'direct_dependent_settings': {

+        'conditions': [

+          [ 'OS == "linux"', {

+            'defines': [

+              'GR_LINUX_BUILD=1',

+            ],

+          }],

+          [ 'OS == "mac"', {

+            'defines': [

+              'GR_MAC_BUILD=1',

+            ],

+          }],

+          [ 'OS == "win"', {

+            'defines': [

+              'GR_WIN32_BUILD=1',

+            ],

+          },],

+        ],

+        'include_dirs': [

+          '../include/gpu',

+        ],

+      },

+    },

+    {

+      'target_name': 'gr',

+      'type': 'static_library',

+      'include_dirs': [

+        '../gpu/include',

+      ],

+      'sources': [

+        '../gpu/include/GrAllocator.h',

+        '../gpu/include/GrAllocPool.h',

+        '../gpu/include/GrAtlas.h',

+        '../gpu/include/GrClip.h',

+        '../gpu/include/GrClipIterator.h',

+        '../gpu/include/GrColor.h',

+        '../gpu/include/GrConfig.h',

+        '../gpu/include/GrContext.h',

+        '../gpu/include/GrContext_impl.h',

+        '../gpu/include/GrDrawTarget.h',

+        '../gpu/include/GrFontScaler.h',

+        '../gpu/include/GrGeometryBuffer.h',

+        '../gpu/include/GrGLConfig.h',

+        '../gpu/include/GrGLConfig_chrome.h',

+        '../gpu/include/GrGLIndexBuffer.h',

+        '../gpu/include/GrGLInterface.h',

+        '../gpu/include/GrGLIRect.h',

+        '../gpu/include/GrGLPlatformIncludes.h',

+        '../gpu/include/GrGLTexture.h',

+        '../gpu/include/GrGLVertexBuffer.h',

+        '../gpu/include/GrGlyph.h',

+        '../gpu/include/GrGpu.h',

+        '../gpu/include/GrGpuVertex.h',

+        '../gpu/include/GrIndexBuffer.h',

+        '../gpu/include/GrInOrderDrawBuffer.h',

+        '../gpu/include/GrInstanceCounter.h',

+        '../gpu/include/GrIPoint.h',

+        '../gpu/include/GrKey.h',

+        '../gpu/include/GrMatrix.h',

+        '../gpu/include/GrMemory.h',

+        '../gpu/include/GrMesh.h',

+        '../gpu/include/GrNoncopyable.h',

+        '../gpu/include/GrPaint.h',

+        '../gpu/include/GrPath.h',

+        '../gpu/include/GrPathIter.h',

+        '../gpu/include/GrPathSink.h',

+        '../gpu/include/GrPlotMgr.h',

+        '../gpu/include/GrPoint.h',

+        '../gpu/include/GrRandom.h',

+        '../gpu/include/GrRect.h',

+        '../gpu/include/GrRectanizer.h',

+        '../gpu/include/GrRefCnt.h',

+        '../gpu/include/GrSamplerState.h',

+        '../gpu/include/GrScalar.h',

+        '../gpu/include/GrStencil.h',

+        '../gpu/include/GrStopwatch.h',

+        '../gpu/include/GrStringBuilder.h',

+        '../gpu/include/GrTArray.h',

+        '../gpu/include/GrTBSearch.h',

+        '../gpu/include/GrTDArray.h',

+        '../gpu/include/GrTextContext.h',

+        '../gpu/include/GrTextStrike.h',

+        '../gpu/include/GrTexture.h',

+        '../gpu/include/GrTextureCache.h',

+        '../gpu/include/GrTHashCache.h',

+        '../gpu/include/GrTLList.h',

+        '../gpu/include/GrTouchGesture.h',

+        '../gpu/include/GrTypes.h',

+        '../gpu/include/GrUserConfig.h',

+        '../gpu/include/GrVertexBuffer.h',

+

+        '../gpu/src/GrAllocPool.cpp',

+        '../gpu/src/GrAtlas.cpp',

+        '../gpu/src/GrBufferAllocPool.cpp',

+        '../gpu/src/GrBufferAllocPool.h',

+        '../gpu/src/GrClip.cpp',

+        '../gpu/src/GrContext.cpp',

+        '../gpu/src/GrDrawTarget.cpp',

+        '../gpu/src/GrGLIndexBuffer.cpp',

+        '../gpu/src/GrGLInterface.cpp',

+        '../gpu/src/GrGLTexture.cpp',

+        '../gpu/src/GrGLUtil.cpp',

+        '../gpu/src/GrGLVertexBuffer.cpp',

+        '../gpu/src/GrGpu.cpp',

+        '../gpu/src/GrGpuFactory.cpp',

+        '../gpu/src/GrGpuGL.cpp',

+        '../gpu/src/GrGpuGL.h',

+        '../gpu/src/GrGpuGLFixed.cpp',

+        '../gpu/src/GrGpuGLFixed.h',

+        '../gpu/src/GrGpuGLShaders2.cpp',

+        '../gpu/src/GrGpuGLShaders2.h',

+        '../gpu/src/GrInOrderDrawBuffer.cpp',

+        '../gpu/src/GrMatrix.cpp',

+        '../gpu/src/GrMemory.cpp',

+        '../gpu/src/GrPath.cpp',

+        '../gpu/src/GrPathRenderer.cpp',

+        '../gpu/src/GrPathRenderer.h',

+        '../gpu/src/GrPrintf_printf.cpp',

+        '../gpu/src/GrRectanizer.cpp',

+        '../gpu/src/GrRedBlackTree.h',

+        '../gpu/src/GrStencil.cpp',

+        '../gpu/src/GrTextContext.cpp',

+        '../gpu/src/GrTextStrike.cpp',

+        '../gpu/src/GrTextStrike_impl.h',

+        '../gpu/src/GrTextureCache.cpp',

+        '../gpu/src/gr_unittests.cpp',

+      ],

+      'conditions': [

+        [ 'OS == "linux"', {

+          'defines': [

+              'GR_LINUX_BUILD=1',

+          ],

+          'link_settings': {

+            'libraries': [

+              '-lGL',

+              '-lX11',

+            ],

+          },  

+        }],

+        [ 'OS == "mac"', {

+          'defines': [

+              'GR_MAC_BUILD=1',

+          ],

+          'link_settings': {

+            'libraries': [

+              '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',

+            ],

+          },  

+          }],

+        [ 'OS == "win"', {

+          'defines': [

+            'GR_WIN32_BUILD=1',

+          ],

+        },],

+      ],

+      'direct_dependent_settings': {

+        'conditions': [

+          [ 'OS == "linux"', {

+            'defines': [

+              'GR_LINUX_BUILD=1',

+            ],

+          }],

+          [ 'OS == "mac"', {

+            'defines': [

+              'GR_MAC_BUILD=1',

+            ],

+          }],

+          [ 'OS == "win"', {

+            'defines': [

+              'GR_WIN32_BUILD=1',

+            ],

+          },],

+        ],

+        'include_dirs': [

+          '../gpu/include',

+        ],

+      },

+    },

+    {

+      'target_name': 'animator',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/effects',

+        '../include/animator',

+        '../include/views',

+        '../include/xml',

+        '../include/utils',

+        '../include/images',

+      ],

+      'sources': [

+        '../include/animator/SkAnimator.h',

+        '../include/animator/SkAnimatorView.h',

+

+        '../src/animator/SkAnimate.h',

+        '../src/animator/SkAnimateActive.cpp',

+        '../src/animator/SkAnimateActive.h',

+        '../src/animator/SkAnimateBase.cpp',

+        '../src/animator/SkAnimateBase.h',

+        '../src/animator/SkAnimateField.cpp',

+        '../src/animator/SkAnimateMaker.cpp',

+        '../src/animator/SkAnimateMaker.h',

+        '../src/animator/SkAnimateProperties.h',

+        '../src/animator/SkAnimateSet.cpp',

+        '../src/animator/SkAnimateSet.h',

+        '../src/animator/SkAnimator.cpp',

+        '../src/animator/SkAnimatorScript.cpp',

+        '../src/animator/SkAnimatorScript.h',

+        #'../src/animator/SkAnimatorScript2.cpp', fails on windows

+        #'../src/animator/SkAnimatorScript2.h', 

+        '../src/animator/SkBase64.cpp',

+        '../src/animator/SkBase64.h',

+        '../src/animator/SkBoundable.cpp',

+        '../src/animator/SkBoundable.h',

+        '../src/animator/SkBuildCondensedInfo.cpp',

+        #'../src/animator/SkCondensedDebug.cpp', fails on windows

+        '../src/animator/SkCondensedRelease.cpp',

+        '../src/animator/SkDisplayable.cpp',

+        '../src/animator/SkDisplayable.h',

+        '../src/animator/SkDisplayAdd.cpp',

+        '../src/animator/SkDisplayAdd.h',

+        '../src/animator/SkDisplayApply.cpp',

+        '../src/animator/SkDisplayApply.h',

+        '../src/animator/SkDisplayBounds.cpp',

+        '../src/animator/SkDisplayBounds.h',

+        '../src/animator/SkDisplayEvent.cpp',

+        '../src/animator/SkDisplayEvent.h',

+        '../src/animator/SkDisplayEvents.cpp',

+        '../src/animator/SkDisplayEvents.h',

+        '../src/animator/SkDisplayInclude.cpp',

+        '../src/animator/SkDisplayInclude.h',

+        '../src/animator/SkDisplayInput.cpp',

+        '../src/animator/SkDisplayInput.h',

+        '../src/animator/SkDisplayList.cpp',

+        '../src/animator/SkDisplayList.h',

+        '../src/animator/SkDisplayMath.cpp',

+        '../src/animator/SkDisplayMath.h',

+        '../src/animator/SkDisplayMovie.cpp',

+        '../src/animator/SkDisplayMovie.h',

+        '../src/animator/SkDisplayNumber.cpp',

+        '../src/animator/SkDisplayNumber.h',

+        '../src/animator/SkDisplayPost.cpp',

+        '../src/animator/SkDisplayPost.h',

+        '../src/animator/SkDisplayRandom.cpp',

+        '../src/animator/SkDisplayRandom.h',

+        '../src/animator/SkDisplayScreenplay.cpp',

+        '../src/animator/SkDisplayScreenplay.h',

+        '../src/animator/SkDisplayType.cpp',

+        '../src/animator/SkDisplayType.h',

+        '../src/animator/SkDisplayTypes.cpp',

+        '../src/animator/SkDisplayTypes.h',

+        '../src/animator/SkDisplayXMLParser.cpp',

+        '../src/animator/SkDisplayXMLParser.h',

+        '../src/animator/SkDraw3D.cpp',

+        '../src/animator/SkDraw3D.h',

+        '../src/animator/SkDrawable.cpp',

+        '../src/animator/SkDrawable.h',

+        '../src/animator/SkDrawBitmap.cpp',

+        '../src/animator/SkDrawBitmap.h',

+        '../src/animator/SkDrawBlur.cpp',

+        '../src/animator/SkDrawBlur.h',

+        '../src/animator/SkDrawClip.cpp',

+        '../src/animator/SkDrawClip.h',

+        '../src/animator/SkDrawColor.cpp',

+        '../src/animator/SkDrawColor.h',

+        '../src/animator/SkDrawDash.cpp',

+        '../src/animator/SkDrawDash.h',

+        '../src/animator/SkDrawDiscrete.cpp',

+        '../src/animator/SkDrawDiscrete.h',

+        '../src/animator/SkDrawEmboss.cpp',

+        '../src/animator/SkDrawEmboss.h',

+        '../src/animator/SkDrawExtraPathEffect.cpp',

+        '../src/animator/SkDrawFull.cpp',

+        '../src/animator/SkDrawFull.h',

+        '../src/animator/SkDrawGradient.cpp',

+        '../src/animator/SkDrawGradient.h',

+        '../src/animator/SkDrawGroup.cpp',

+        '../src/animator/SkDrawGroup.h',

+        '../src/animator/SkDrawLine.cpp',

+        '../src/animator/SkDrawLine.h',

+        '../src/animator/SkDrawMatrix.cpp',

+        '../src/animator/SkDrawMatrix.h',

+        '../src/animator/SkDrawOval.cpp',

+        '../src/animator/SkDrawOval.h',

+        '../src/animator/SkDrawPaint.cpp',

+        '../src/animator/SkDrawPaint.h',

+        '../src/animator/SkDrawPath.cpp',

+        '../src/animator/SkDrawPath.h',

+        '../src/animator/SkDrawPoint.cpp',

+        '../src/animator/SkDrawPoint.h',

+        '../src/animator/SkDrawRectangle.cpp',

+        '../src/animator/SkDrawRectangle.h',

+        '../src/animator/SkDrawSaveLayer.cpp',

+        '../src/animator/SkDrawSaveLayer.h',

+        '../src/animator/SkDrawShader.cpp',

+        '../src/animator/SkDrawShader.h',

+        '../src/animator/SkDrawText.cpp',

+        '../src/animator/SkDrawText.h',

+        '../src/animator/SkDrawTextBox.cpp',

+        '../src/animator/SkDrawTextBox.h',

+        '../src/animator/SkDrawTo.cpp',

+        '../src/animator/SkDrawTo.h',

+        '../src/animator/SkDrawTransparentShader.cpp',

+        '../src/animator/SkDrawTransparentShader.h',

+        '../src/animator/SkDump.cpp',

+        '../src/animator/SkDump.h',

+        '../src/animator/SkExtras.h',

+        '../src/animator/SkGetCondensedInfo.cpp',

+        '../src/animator/SkHitClear.cpp',

+        '../src/animator/SkHitClear.h',

+        '../src/animator/SkHitTest.cpp',

+        '../src/animator/SkHitTest.h',

+        '../src/animator/SkIntArray.h',

+        '../src/animator/SkMatrixParts.cpp',

+        '../src/animator/SkMatrixParts.h',

+        '../src/animator/SkMemberInfo.cpp',

+        '../src/animator/SkMemberInfo.h',

+        '../src/animator/SkOpArray.cpp',

+        '../src/animator/SkOpArray.h',

+        '../src/animator/SkOperand.h',

+        '../src/animator/SkOperand2.h',

+        '../src/animator/SkOperandInterpolator.h',

+        '../src/animator/SkOperandIterpolator.cpp',

+        '../src/animator/SkPaintParts.cpp',

+        '../src/animator/SkPaintParts.h',

+        '../src/animator/SkParseSVGPath.cpp',

+        '../src/animator/SkPathParts.cpp',

+        '../src/animator/SkPathParts.h',

+        '../src/animator/SkPostParts.cpp',

+        '../src/animator/SkPostParts.h',

+        '../src/animator/SkScript.cpp',

+        '../src/animator/SkScript.h',

+        '../src/animator/SkScript2.h',

+        '../src/animator/SkScriptCallBack.h',

+        '../src/animator/SkScriptDecompile.cpp',

+        '../src/animator/SkScriptRuntime.cpp',

+        '../src/animator/SkScriptRuntime.h',

+        '../src/animator/SkScriptTokenizer.cpp',

+        '../src/animator/SkSnapshot.cpp',

+        '../src/animator/SkSnapshot.h',

+        '../src/animator/SkTDArray_Experimental.h',

+        '../src/animator/SkTextOnPath.cpp',

+        '../src/animator/SkTextOnPath.h',

+        '../src/animator/SkTextToPath.cpp',

+        '../src/animator/SkTextToPath.h',

+        '../src/animator/SkTime.cpp',

+        '../src/animator/SkTypedArray.cpp',

+        '../src/animator/SkTypedArray.h',

+        '../src/animator/SkXMLAnimatorWriter.cpp',

+        '../src/animator/SkXMLAnimatorWriter.h',

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/animator',

+        ],

+      },

+    },

+

+    {

+      'target_name': 'svg',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+        '../include/xml',

+        '../include/utils',

+        '../include/svg',

+      ],

+      'sources': [

+        '../include/svg/SkSVGAttribute.h',

+        '../include/svg/SkSVGBase.h',

+        '../include/svg/SkSVGPaintState.h',

+        '../include/svg/SkSVGParser.h',

+        '../include/svg/SkSVGTypes.h',

+

+        '../src/svg/SkSVGCircle.cpp',

+        '../src/svg/SkSVGCircle.h',

+        '../src/svg/SkSVGClipPath.cpp',

+        '../src/svg/SkSVGClipPath.h',

+        '../src/svg/SkSVGDefs.cpp',

+        '../src/svg/SkSVGDefs.h',

+        '../src/svg/SkSVGElements.cpp',

+        '../src/svg/SkSVGElements.h',

+        '../src/svg/SkSVGEllipse.cpp',

+        '../src/svg/SkSVGEllipse.h',

+        '../src/svg/SkSVGFeColorMatrix.cpp',

+        '../src/svg/SkSVGFeColorMatrix.h',

+        '../src/svg/SkSVGFilter.cpp',

+        '../src/svg/SkSVGFilter.h',

+        '../src/svg/SkSVGG.cpp',

+        '../src/svg/SkSVGG.h',

+        '../src/svg/SkSVGGradient.cpp',

+        '../src/svg/SkSVGGradient.h',

+        '../src/svg/SkSVGGroup.cpp',

+        '../src/svg/SkSVGGroup.h',

+        '../src/svg/SkSVGImage.cpp',

+        '../src/svg/SkSVGImage.h',

+        '../src/svg/SkSVGLine.cpp',

+        '../src/svg/SkSVGLine.h',

+        '../src/svg/SkSVGLinearGradient.cpp',

+        '../src/svg/SkSVGLinearGradient.h',

+        '../src/svg/SkSVGMask.cpp',

+        '../src/svg/SkSVGMask.h',

+        '../src/svg/SkSVGMetadata.cpp',

+        '../src/svg/SkSVGMetadata.h',

+        '../src/svg/SkSVGPaintState.cpp',

+        '../src/svg/SkSVGParser.cpp',

+        '../src/svg/SkSVGPath.cpp',

+        '../src/svg/SkSVGPath.h',

+        '../src/svg/SkSVGPolygon.cpp',

+        '../src/svg/SkSVGPolygon.h',

+        '../src/svg/SkSVGPolyline.cpp',

+        '../src/svg/SkSVGPolyline.h',

+        '../src/svg/SkSVGRadialGradient.cpp',

+        '../src/svg/SkSVGRadialGradient.h',

+        '../src/svg/SkSVGRect.cpp',

+        '../src/svg/SkSVGRect.h',

+        '../src/svg/SkSVGStop.cpp',

+        '../src/svg/SkSVGStop.h',

+        '../src/svg/SkSVGSVG.cpp',

+        '../src/svg/SkSVGSVG.h',

+        '../src/svg/SkSVGSymbol.cpp',

+        '../src/svg/SkSVGSymbol.h',

+        '../src/svg/SkSVGText.cpp',

+        '../src/svg/SkSVGText.h',

+        '../src/svg/SkSVGUse.cpp',

+      ],

+      'sources!' : [

+          '../src/svg/SkSVG.cpp', # doesn't compile, maybe this is test code?

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../include/svg',

+        ],

+      },

+    },

+

+    {

+      'target_name': 'experimental',

+      'type': 'static_library',

+      'include_dirs': [

+        '../include/config',

+        '../include/core',

+      ],

+      'sources': [

+        '../experimental/SkMatrix44.cpp',

+        '../experimental/SkMatrix44.h',

+        '../experimental/SkSetPoly3To3.cpp',

+        '../experimental/SkSetPoly3To3_A.cpp',

+        '../experimental/SkSetPoly3To3_D.cpp',

+      ],

+      'sources!': [

+        '../experimental/SkMatrix44.cpp',  #doesn't compile

+        '../experimental/SkMatrix44.h',

+      ],

+      'direct_dependent_settings': {

+        'include_dirs': [

+          '../experimental',

+        ],

+      },

+    },

+

+    {

+      'target_name': 'SampleApp',

+      'type': 'executable',

+      'mac_bundle' : 1,

+      'include_dirs' : [

+        '../src/core', # needed to get SkConcaveToTriangle, maybe this should be moved to include dir?

+        '../gm',       # SampleGM.cpp pulls gm.h

+      ],

+      'sources': [

+        # gm files needed for SampleGM.cpp

+        '../gm/bitmapfilters.cpp',

+        '../gm/blurs.cpp',

+        '../gm/complexclip.cpp',

+        '../gm/filltypes.cpp',

+        '../gm/gm.h',

+        '../gm/gradients.cpp',

+        '../gm/points.cpp',

+        '../gm/poly2poly.cpp',

+        '../gm/shadertext.cpp',

+        '../gm/shadows.cpp',

+        '../gm/shapes.cpp',

+        '../gm/tilemodes.cpp',

+        '../gm/xfermodes.cpp',

+

+        '../samplecode/ClockFaceView.cpp',

+        '../samplecode/OverView.cpp',

+        '../samplecode/SampleAll.cpp',

+        '../samplecode/SampleAnimator.cpp',

+        '../samplecode/SampleApp.cpp',

+        '../samplecode/SampleArc.cpp',

+        '../samplecode/SampleAvoid.cpp',

+        '../samplecode/SampleBigGradient.cpp',

+        '../samplecode/SampleBitmapRect.cpp',

+        '../samplecode/SampleBlur.cpp',

+        '../samplecode/SampleCamera.cpp',

+        '../samplecode/SampleCircle.cpp',

+        '../samplecode/SampleCode.h',

+        '../samplecode/SampleComplexClip.cpp',

+        '../samplecode/SampleCull.cpp',

+        '../samplecode/SampleDecode.cpp',

+        '../samplecode/SampleDither.cpp',

+        '../samplecode/SampleDitherBitmap.cpp',

+        '../samplecode/SampleDrawLooper.cpp',

+        '../samplecode/SampleEffects.cpp',

+        '../samplecode/SampleEmboss.cpp',

+        '../samplecode/SampleEncode.cpp',

+        '../samplecode/SampleExtractAlpha.cpp',

+        '../samplecode/SampleFillType.cpp',

+        '../samplecode/SampleFilter.cpp',

+        '../samplecode/SampleFilter2.cpp',

+        '../samplecode/SampleFontCache.cpp',

+        '../samplecode/SampleFontScalerTest.cpp',

+        '../samplecode/SampleFuzz.cpp',

+        '../samplecode/SampleGM.cpp',

+        '../samplecode/SampleGradients.cpp',

+        '../samplecode/SampleHairline.cpp',

+        '../samplecode/SampleImage.cpp',

+        '../samplecode/SampleImageDir.cpp',

+        '../samplecode/SampleLayerMask.cpp',

+        '../samplecode/SampleLayers.cpp',

+        '../samplecode/SampleLCD.cpp',

+        '../samplecode/SampleLineClipper.cpp',

+        '../samplecode/SampleLines.cpp',

+        '../samplecode/SampleMeasure.cpp',

+        '../samplecode/SampleMipMap.cpp',

+        '../samplecode/SampleMovie.cpp',

+        '../samplecode/SampleNinePatch.cpp',

+        '../samplecode/SampleOvalTest.cpp',

+        '../samplecode/SampleOverflow.cpp',

+        '../samplecode/SamplePageFlip.cpp',

+        '../samplecode/SamplePatch.cpp',

+        '../samplecode/SamplePath.cpp',

+        '../samplecode/SamplePathClip.cpp',

+        '../samplecode/SamplePathEffects.cpp',

+        '../samplecode/SamplePicture.cpp',

+        '../samplecode/SamplePoints.cpp',

+        '../samplecode/SamplePolyToPoly.cpp',

+        '../samplecode/SampleRegion.cpp',

+        '../samplecode/SampleRepeatTile.cpp',

+        '../samplecode/SampleShaders.cpp',

+        '../samplecode/SampleShaderText.cpp',

+        '../samplecode/SampleShapes.cpp',

+        '../samplecode/SampleSkLayer.cpp',

+        '../samplecode/SampleSlides.cpp',

+        '../samplecode/SampleStrokePath.cpp',

+        '../samplecode/SampleStrokeText.cpp',

+        '../samplecode/SampleSVG.cpp',

+        '../samplecode/SampleTests.cpp',

+        '../samplecode/SampleText.cpp',

+        '../samplecode/SampleTextAlpha.cpp',

+        '../samplecode/SampleTextBox.cpp',

+        '../samplecode/SampleTextEffects.cpp',

+        '../samplecode/SampleTextOnPath.cpp',

+        '../samplecode/SampleTiling.cpp',

+        '../samplecode/SampleTinyBitmap.cpp',

+        '../samplecode/SampleTriangles.cpp',

+        '../samplecode/SampleTypeface.cpp',

+        '../samplecode/SampleUnitMapper.cpp',

+        '../samplecode/SampleVertices.cpp',

+        '../samplecode/SampleXfermodes.cpp',

+      ],

+      'sources!': [

+        '../samplecode/SampleSkLayer.cpp', #relies on SkMatrix44 which doesn't compile

+        '../samplecode/SampleTests.cpp',   #includes unknown file SkShaderExtras.h

+        '../samplecode/SampleWarp.cpp',

+        '../samplecode/SampleFontCache.cpp',

+      ],

+      'dependencies': [

+        'skia',

+        'effects',

+        'images',

+        'views',

+        'utils',

+        'animator',

+        'xml',

+        'svg',

+        'experimental',

+        'gr',

+        'skgr',

+      ],

+      'conditions' : [

+       [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {

+         'sources!': [

+            '../samplecode/SampleDecode.cpp',

+         ],

+        }],

+        [ 'OS == "win"', {

+          'sources!': [

+            # require UNIX functions

+            '../samplecode/SampleEncode.cpp',

+            '../samplecode/SamplePageFlip.cpp',

+          ],

+        },],

+        [ 'OS == "mac"', {

+          'sources!': [

+            '../samplecode/SampleDecode.cpp',

+          ],

+        },],

+

+      ],

+      'msvs_settings': {

+        'VCLinkerTool': {

+          'SubSystem': '2',

+          'AdditionalDependencies': [

+              'OpenGL32.lib',

+              'glew32.lib',

+              'usp10.lib',

+              'd3d9.lib',

+          ],

+        },

+      },

+    },

+  ],

+}

+

+# Local Variables:

+# tab-width:2

+# indent-tabs-mode:nil

+# End:

+# vim: set expandtab tabstop=2 shiftwidth=2:

diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index 09f24b5b..4fca656 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -50,10 +50,10 @@
     #define SK_ScalarInfinity           (*(const float*)&gIEEEInfinity)
     /** SK_ScalarMax is defined to be the largest value representable as an SkScalar
     */
-    #define SK_ScalarMax            (3.4028235e+38f)
+    #define SK_ScalarMax            (3.402823466e+38f)
     /** SK_ScalarMin is defined to be the smallest value representable as an SkScalar
     */
-    #define SK_ScalarMin            (1.1754944e-38f)
+    #define SK_ScalarMin            (1.175494351e-38f)
     /** SK_ScalarNaN is defined to be 'Not a Number' as an SkScalar
     */
     #define SK_ScalarNaN      (*(const float*)(const void*)&gIEEENotANumber)
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index 1b008e1..e991828 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -39,7 +39,7 @@
     void* getDisplay() const { return (void*)fUnixWindow.fDisplay; }
     void* getUnixWindow() const { return (void*)&fUnixWindow; }
     void setUnixWindow(Display*, Window, size_t, GC);
-    bool attachGL(const SkBitmap* offscreen);
+    bool attachGL();
     void detachGL();
     void presentGL();
 
diff --git a/include/views/SkWidgetViews.h b/include/views/SkWidgetViews.h
index 4dd8866..9b3a816 100644
--- a/include/views/SkWidgetViews.h
+++ b/include/views/SkWidgetViews.h
@@ -117,6 +117,8 @@
 protected:
     // overrides
     virtual bool onEvent(const SkEvent&);
+private:
+    typedef SkWidgetView INHERITED;
 };
 
 ////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/animator/SkDisplayXMLParser.cpp b/src/animator/SkDisplayXMLParser.cpp
index d2775e8..2de80ca 100644
--- a/src/animator/SkDisplayXMLParser.cpp
+++ b/src/animator/SkDisplayXMLParser.cpp
@@ -164,6 +164,14 @@
     return false;
 }
 
+#if defined(SKIA_BUILD_FOR_WIN32)
+    #define SK_strcasecmp   stricmp
+    #define SK_strncasecmp  strnicmp
+#else
+    #define SK_strcasecmp   strcasecmp
+    #define SK_strncasecmp  strncasecmp
+#endif
+
 bool SkDisplayXMLParser::onEndElement(const char elem[])
 {
     int parentIndex = fParents.count() - 1;
@@ -199,7 +207,7 @@
         fParents.remove(parentIndex);
     }
     fCurrDisplayable = NULL;
-    if (fInInclude == false && strcasecmp(elem, "screenplay") == 0) {
+    if (fInInclude == false && SK_strcasecmp(elem, "screenplay") == 0) {
         if (fMaker.fInMovie == false) {
             fMaker.fEnableTime = fMaker.getAppTime();
 #if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
@@ -231,7 +239,7 @@
 bool SkDisplayXMLParser::onStartElementLen(const char name[], size_t len) {
     fCurrDisplayable = NULL; // init so we'll ignore attributes if we exit early
 
-    if (strncasecmp(name, "screenplay", len) == 0) {
+    if (SK_strncasecmp(name, "screenplay", len) == 0) {
         fInSkia = true;
         if (fInInclude == false)
             fMaker.idsSet(name, len, &fMaker.fScreenplay);
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index a4f430c..e6f83c1 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -449,7 +449,11 @@
         COLORREF color = SetTextColor(dc, 0); // black
         SkASSERT(color != CLR_INVALID);
         uint16_t glyphID = glyph.getGlyphID();
+#if defined(UNICODE)
         ExtTextOut(dc, 0, 0, ETO_GLYPH_INDEX, NULL, (LPCWSTR)&glyphID, 1, NULL);
+#else
+        ExtTextOut(dc, 0, 0, ETO_GLYPH_INDEX, NULL, (LPCSTR)&glyphID, 1, NULL);
+#endif
         GdiFlush();
 
         // downsample from rgba to rgb565
diff --git a/src/svg/SkSVGPaintState.cpp b/src/svg/SkSVGPaintState.cpp
index 7fc90c7..f3c65e7 100644
--- a/src/svg/SkSVGPaintState.cpp
+++ b/src/svg/SkSVGPaintState.cpp
@@ -321,7 +321,7 @@
                 if (strncmp(attrValue, "url(", 4) == 0) {
                     SkASSERT(attrValue[4] == '#');
                     const char* idStart = attrValue + 5;
-                    char* idEnd = strrchr(attrValue, ')');
+                    const char* idEnd = strrchr(attrValue, ')');
                     SkASSERT(idStart < idEnd);
                     SkString id(idStart, idEnd - idStart);
                     SkSVGElement* found;
diff --git a/src/utils/SkOSFile.cpp b/src/utils/SkOSFile.cpp
index 982bc08..c1b6943 100644
--- a/src/utils/SkOSFile.cpp
+++ b/src/utils/SkOSFile.cpp
@@ -31,18 +31,19 @@
     size_t  len = strlen(src);
 
     fStr = (uint16_t*)sk_malloc_throw((len + 1) * sizeof(uint16_t));
-    for (size_t i = 0; i < len; i++)
+    size_t i;
+    for (i = 0; i < len; i++)
         fStr[i] = src[i];
     fStr[i] = 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////
 
-SkOSFile::Iter::Iter() : fHandle(0), fPath16(nil)
+SkOSFile::Iter::Iter() : fHandle(0), fPath16(NULL)
 {
 }
 
-SkOSFile::Iter::Iter(const char path[], const char suffix[]) : fHandle(0), fPath16(nil)
+SkOSFile::Iter::Iter(const char path[], const char suffix[]) : fHandle(0), fPath16(NULL)
 {
     this->reset(path, suffix);
 }
@@ -61,7 +62,7 @@
         ::FindClose(fHandle);
         fHandle = 0;
     }
-    if (path == nil)
+    if (NULL == path)
         path = "";
 
     sk_free(fPath16);
@@ -78,7 +79,7 @@
 {
     WIN32_FIND_DATAW    data;
 
-    if (dataPtr == nil)
+    if (NULL == dataPtr)
     {
         if (::FindNextFileW(handle, &data))
             dataPtr = &data;
@@ -90,7 +91,7 @@
     {
         if (getDir)
         {
-            if ((dataPtr->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !is_magic_dir(dataPtr->cFileName))
+            if ((dataPtr->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !is_magic_dir((uint16_t*)dataPtr->cFileName))
                 break;
         }
         else
@@ -103,21 +104,21 @@
     }
     // if we get here, we've found a file/dir
     if (name)
-        name->setUTF16(dataPtr->cFileName);
+        name->setUTF16((uint16_t*)dataPtr->cFileName);
     return true;
 }
 
 bool SkOSFile::Iter::next(SkString* name, bool getDir)
 {
     WIN32_FIND_DATAW    data;
-    WIN32_FIND_DATAW*   dataPtr = nil;
+    WIN32_FIND_DATAW*   dataPtr = NULL;
 
     if (fHandle == 0)   // our first time
     {
-        if (fPath16 == nil || *fPath16 == 0)    // check for no path
+        if (fPath16 == NULL || *fPath16 == 0)    // check for no path
             return false;
 
-        fHandle = ::FindFirstFileW(fPath16, &data);
+        fHandle = ::FindFirstFileW((LPCWSTR)fPath16, &data);
         if (fHandle != 0 && fHandle != (HANDLE)~0)
             dataPtr = &data;
     }
diff --git a/src/utils/mac/skia_mac.cp b/src/utils/mac/skia_mac.cp
deleted file mode 100644
index f6be570..0000000
--- a/src/utils/mac/skia_mac.cp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <Carbon/Carbon.h>
-#include "SkApplication.h"
-#include "SkWindow.h"
-
-int main(int argc, char* argv[])
-{
-    IBNibRef			nibRef;
-    WindowRef			window;
-    OSStatus			err = noErr;
-
-    // Create a Nib reference passing the name of the nib file (without the .nib extension)
-    // CreateNibReference only searches into the application bundle.
-    err = CreateNibReference(CFSTR("main"), &nibRef);
-    require_noerr( err, CantGetNibRef );
-    
-    // Then create a window. "MainWindow" is the name of the window object. This name is set in 
-    // InterfaceBuilder when the nib is created.
-    err = CreateWindowFromNib(nibRef, CFSTR("MainWindow"), &window);
-    require_noerr( err, CantCreateWindow );
-    
-    // We don't need the nib reference anymore.
-    DisposeNibReference(nibRef);
-    
-    // if we get here, we can start our normal Skia sequence
-    {
-        application_init();
-        (void)create_sk_window(window);
-        SizeWindow(window, 640, 480, false);
-    }
-    
-    // The window was created hidden so show it.
-    ShowWindow( window );
-    
-    // Call the event loop
-    RunApplicationEventLoop();
-
-	application_term();
-
-CantCreateWindow:
-CantGetNibRef:
-	return err;
-}
-
diff --git a/src/utils/mac/skia_mac.cpp b/src/utils/mac/skia_mac.cpp
new file mode 100644
index 0000000..a1345cf
--- /dev/null
+++ b/src/utils/mac/skia_mac.cpp
@@ -0,0 +1,43 @@
+#include <Carbon/Carbon.h>

+#include "SkApplication.h"

+#include "SkWindow.h"

+

+int main(int argc, char* argv[])

+{

+    WindowRef			window;

+    OSStatus			err = noErr;

+

+    Rect bounds = {100, 100, 500, 500};

+    WindowAttributes attrs = kWindowStandardHandlerAttribute | 

+                             kWindowLiveResizeAttribute |

+                             kWindowInWindowMenuAttribute | 

+                             kWindowCompositingAttribute |

+                             kWindowAsyncDragAttribute | 

+                             kWindowFullZoomAttribute | 

+                             kWindowFrameworkScaledAttribute;

+                             //kWindowDoesNotCycleAttribute;

+    CreateNewWindow(kDocumentWindowClass, attrs, &bounds, &window);

+

+    MenuRef menu;

+    CreateNewMenu(0, 0, &menu);

+

+    // if we get here, we can start our normal Skia sequence

+    {

+        application_init();

+        (void)create_sk_window(window);

+        SizeWindow(window, 640, 480, false);

+    }

+    

+    // The window was created hidden so show it.

+    ShowWindow( window );

+    

+    // Call the event loop

+    RunApplicationEventLoop();

+

+	application_term();

+

+CantCreateWindow:

+CantGetNibRef:

+	return err;

+}

+

diff --git a/src/utils/unix/SkOSWindow_Unix.cpp b/src/utils/unix/SkOSWindow_Unix.cpp
index 75e8209..96940f5 100644
--- a/src/utils/unix/SkOSWindow_Unix.cpp
+++ b/src/utils/unix/SkOSWindow_Unix.cpp
@@ -26,7 +26,7 @@
     fUnixWindow.fGc = gc;
 }
 
-bool SkOSWindow::attachGL(const SkBitmap* offscreen)
+bool SkOSWindow::attachGL()
 {
     return false;
 }
diff --git a/src/utils/win/SkOSWindow_Win.cpp b/src/utils/win/SkOSWindow_Win.cpp
index 38bbea9..44d23cf 100644
--- a/src/utils/win/SkOSWindow_Win.cpp
+++ b/src/utils/win/SkOSWindow_Win.cpp
@@ -275,6 +275,12 @@
     }
 }
 
+#if defined(UNICODE)
+    #define STR_LIT(X) L## #X
+#else
+    #define STR_LIT(X) #X
+#endif
+
 static HWND create_dummy()
 {
     HMODULE module = GetModuleHandle(NULL);
@@ -296,7 +302,7 @@
     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
     wc.hbrBackground = NULL;
     wc.lpszMenuName = NULL;
-    wc.lpszClassName = L"DummyWindow";
+    wc.lpszClassName = STR_LIT("DummyWindow");
 
     if(!RegisterClass(&wc))
     {
@@ -308,10 +314,9 @@
     style = WS_SYSMENU;
 
     AdjustWindowRectEx(&windowRect, style, false, exStyle);
-
     if(!(dummy = CreateWindowEx(exStyle,
-        L"DummyWindow",
-        L"Dummy Window",
+        STR_LIT("DummyWindow"),
+        STR_LIT("Dummy Window"),
         WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
         0, 0,
         windowRect.right-windowRect.left,
@@ -320,7 +325,7 @@
         module,
         NULL)))
     {
-        UnregisterClass(L"Dummy Window", module);
+        UnregisterClass(STR_LIT("Dummy Window"), module);
         return NULL;
     }
     ShowWindow(dummy, SW_HIDE);
@@ -331,7 +336,7 @@
 void kill_dummy(HWND dummy) {
     DestroyWindow(dummy);
     HMODULE module = GetModuleHandle(NULL);
-    UnregisterClass(L"Dummy Window", module);
+    UnregisterClass(STR_LIT("Dummy Window"), module);
 }
 
 // WGL_ARB_pixel_format
diff --git a/src/utils/win/skia_win.cpp b/src/utils/win/skia_win.cpp
new file mode 100644
index 0000000..5ef1f7a
--- /dev/null
+++ b/src/utils/win/skia_win.cpp
@@ -0,0 +1,167 @@
+#include <Windows.h>

+#include <tchar.h>

+#define MAX_LOADSTRING 100

+

+// Global Variables:

+HINSTANCE hInst;                            // current instance

+TCHAR szTitle[] = _T("SampleApp");          // The title bar text

+TCHAR szWindowClass[] = _T("SAMPLEAPP");    // the main window class name

+

+// Forward declarations of functions included in this code module:

+ATOM                MyRegisterClass(HINSTANCE hInstance);

+BOOL                InitInstance(HINSTANCE, int);

+LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);

+INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

+

+int APIENTRY _tWinMain(HINSTANCE hInstance,

+                     HINSTANCE hPrevInstance,

+                     LPTSTR    lpCmdLine,

+                     int       nCmdShow)

+{

+    UNREFERENCED_PARAMETER(hPrevInstance);

+    UNREFERENCED_PARAMETER(lpCmdLine);

+

+    MSG msg;

+

+    // Initialize global strings

+    MyRegisterClass(hInstance);

+

+    // Perform application initialization:

+    if (!InitInstance (hInstance, nCmdShow))

+    {

+        return FALSE;

+    }

+

+    // Main message loop:

+    while (GetMessage(&msg, NULL, 0, 0))

+    {

+        if (true)

+        {

+            TranslateMessage(&msg);

+            DispatchMessage(&msg);

+        }

+    }

+

+    return (int) msg.wParam;

+}

+

+

+

+//

+//  FUNCTION: MyRegisterClass()

+//

+//  PURPOSE: Registers the window class.

+//

+//  COMMENTS:

+//

+//    This function and its usage are only necessary if you want this code

+//    to be compatible with Win32 systems prior to the 'RegisterClassEx'

+//    function that was added to Windows 95. It is important to call this function

+//    so that the application will get 'well formed' small icons associated

+//    with it.

+//

+ATOM MyRegisterClass(HINSTANCE hInstance)

+{

+    WNDCLASSEX wcex;

+

+    wcex.cbSize = sizeof(WNDCLASSEX);

+

+    wcex.style            = CS_HREDRAW | CS_VREDRAW;

+    wcex.lpfnWndProc    = WndProc;

+    wcex.cbClsExtra        = 0;

+    wcex.cbWndExtra        = 0;

+    wcex.hInstance        = hInstance;

+    wcex.hIcon            = NULL;

+    wcex.hCursor        = NULL;

+    wcex.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);

+    wcex.lpszMenuName    = NULL;

+    wcex.lpszClassName    = szWindowClass;

+    wcex.hIconSm        = NULL;

+

+    return RegisterClassEx(&wcex);

+}

+

+#include "SkOSWindow_Win.h"

+extern SkOSWindow* create_sk_window(void* hwnd);

+

+static SkOSWindow* gSkWind;

+

+//

+//   FUNCTION: InitInstance(HINSTANCE, int)

+//

+//   PURPOSE: Saves instance handle and creates main window

+//

+//   COMMENTS:

+//

+//        In this function, we save the instance handle in a global variable and

+//        create and display the main program window.

+//

+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)

+{

+   HWND hWnd;

+

+   hInst = hInstance; // Store instance handle in our global variable

+

+   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,

+      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

+

+   if (!hWnd)

+   {

+      return FALSE;

+   }

+

+   gSkWind = create_sk_window(hWnd);

+

+   ShowWindow(hWnd, nCmdShow);

+   UpdateWindow(hWnd);

+

+   return TRUE;

+}

+

+//

+//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)

+//

+//  PURPOSE:  Processes messages for the main window.

+//

+//  WM_COMMAND    - process the application menu

+//  WM_PAINT    - Paint the main window

+//  WM_DESTROY    - post a quit message and return

+//

+//

+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

+{

+    switch (message) {

+    case WM_COMMAND:

+        return DefWindowProc(hWnd, message, wParam, lParam);

+    case WM_DESTROY:

+        PostQuitMessage(0);

+        break;

+    default:

+        if (gSkWind->wndProc(hWnd, message, wParam, lParam)) {

+            return 0;

+        } else {

+            return DefWindowProc(hWnd, message, wParam, lParam);

+        }

+    }

+    return 0;

+}

+

+// Message handler for about box.

+INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)

+{

+    UNREFERENCED_PARAMETER(lParam);

+    switch (message)

+    {

+    case WM_INITDIALOG:

+        return (INT_PTR)TRUE;

+

+    case WM_COMMAND:

+        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)

+        {

+            EndDialog(hDlg, LOWORD(wParam));

+            return (INT_PTR)TRUE;

+        }

+        break;

+    }

+    return (INT_PTR)FALSE;

+}

diff --git a/src/views/SkListWidget.cpp b/src/views/SkListWidget.cpp
index f693ebe..89008e7 100644
--- a/src/views/SkListWidget.cpp
+++ b/src/views/SkListWidget.cpp
@@ -31,8 +31,8 @@
 
 SkListView::~SkListView()
 {
-	fScrollBar->safeUnref();
-	fSource->safeUnref();
+	SkSafeUnref(fScrollBar);
+	SkSafeUnref(fSource);
 	delete[] fAnims;
 	delete[] fBindings;
 }
diff --git a/unix_test_app/main.cpp b/unix_test_app/main.cpp
index 6be43c0..d217236 100644
--- a/unix_test_app/main.cpp
+++ b/unix_test_app/main.cpp
@@ -6,7 +6,9 @@
 #include "SkView.h"
 #include "SkWindow.h"
 #include "XkeysToSkKeys.h"
-#include "keysym2ucs.h"
+extern "C" {
+    #include "keysym2ucs.h"
+}
 #include "SkTypes.h"
 //#include <signal.h>
 //#include <sys/time.h>
diff --git a/vs/SampleApp/SampleApp.vcxproj b/vs/SampleApp/SampleApp.vcxproj
index 50b3bc7..b742a96 100644
--- a/vs/SampleApp/SampleApp.vcxproj
+++ b/vs/SampleApp/SampleApp.vcxproj
@@ -460,6 +460,7 @@
     <ClCompile Include="..\..\src\utils\SkParse.cpp" />

     <ClCompile Include="..\..\src\utils\SkParsePath.cpp" />

     <ClCompile Include="..\..\src\utils\SkUnitMappers.cpp" />

+    <ClCompile Include="..\..\src\utils\win\skia_win.cpp" />

     <ClCompile Include="..\..\src\utils\win\SkOSWindow_Win.cpp" />

     <ClCompile Include="..\..\src\views\SkEvent.cpp" />

     <ClCompile Include="..\..\src\views\SkEventSink.cpp" />

@@ -474,7 +475,6 @@
     <ClCompile Include="..\..\src\views\SkWindow.cpp" />

     <ClCompile Include="..\..\src\xml\SkDOM.cpp" />

     <ClCompile Include="..\..\src\xml\SkXMLParser.cpp" />

-    <ClCompile Include="skia_win.cpp" />

     <ClCompile Include="stdafx.cpp">

       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>

diff --git a/vs/SampleApp/SampleApp.vcxproj.filters b/vs/SampleApp/SampleApp.vcxproj.filters
index afcf693..9595b6c 100644
--- a/vs/SampleApp/SampleApp.vcxproj.filters
+++ b/vs/SampleApp/SampleApp.vcxproj.filters
@@ -163,7 +163,6 @@
     <ClCompile Include="..\..\src\views\SkWindow.cpp" />

     <ClCompile Include="..\..\src\xml\SkDOM.cpp" />

     <ClCompile Include="..\..\src\xml\SkXMLParser.cpp" />

-    <ClCompile Include="skia_win.cpp" />

     <ClCompile Include="stdafx.cpp" />

     <ClCompile Include="..\..\gpu\src\gr_unittests.cpp">

       <Filter>Gr\src</Filter>

@@ -459,6 +458,7 @@
     <ClCompile Include="..\..\gpu\src\GrGLInterface.cpp">

       <Filter>Gr\src</Filter>

     </ClCompile>

+    <ClCompile Include="..\..\src\utils\win\skia_win.cpp" />

     <ClCompile Include="..\..\src\views\SkTouchGesture.cpp" />

   </ItemGroup>

   <ItemGroup>

diff --git a/vs/SampleApp/skia_win.cpp b/vs/SampleApp/skia_win.cpp
deleted file mode 100644
index dd02bdb..0000000
--- a/vs/SampleApp/skia_win.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-// SampleApp.cpp : Defines the entry point for the application.

-//

-

-#include "stdafx.h"

-#include "SampleApp.h"

-

-#define MAX_LOADSTRING 100

-

-// Global Variables:

-HINSTANCE hInst;								// current instance

-TCHAR szTitle[MAX_LOADSTRING];					// The title bar text

-TCHAR szWindowClass[MAX_LOADSTRING];			// the main window class name

-

-// Forward declarations of functions included in this code module:

-ATOM				MyRegisterClass(HINSTANCE hInstance);

-BOOL				InitInstance(HINSTANCE, int);

-LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);

-INT_PTR CALLBACK	About(HWND, UINT, WPARAM, LPARAM);

-

-int APIENTRY _tWinMain(HINSTANCE hInstance,

-                     HINSTANCE hPrevInstance,

-                     LPTSTR    lpCmdLine,

-                     int       nCmdShow)

-{

-	UNREFERENCED_PARAMETER(hPrevInstance);

-	UNREFERENCED_PARAMETER(lpCmdLine);

-

- 	// TODO: Place code here.

-	MSG msg;

-	HACCEL hAccelTable;

-

-	// Initialize global strings

-	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);

-	LoadString(hInstance, IDC_SAMPLEAPP, szWindowClass, MAX_LOADSTRING);

-	MyRegisterClass(hInstance);

-

-	// Perform application initialization:

-	if (!InitInstance (hInstance, nCmdShow))

-	{

-		return FALSE;

-	}

-

-	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SAMPLEAPP));

-

-	// Main message loop:

-	while (GetMessage(&msg, NULL, 0, 0))

-	{

-		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))

-		{

-			TranslateMessage(&msg);

-			DispatchMessage(&msg);

-		}

-	}

-

-	return (int) msg.wParam;

-}

-

-

-

-//

-//  FUNCTION: MyRegisterClass()

-//

-//  PURPOSE: Registers the window class.

-//

-//  COMMENTS:

-//

-//    This function and its usage are only necessary if you want this code

-//    to be compatible with Win32 systems prior to the 'RegisterClassEx'

-//    function that was added to Windows 95. It is important to call this function

-//    so that the application will get 'well formed' small icons associated

-//    with it.

-//

-ATOM MyRegisterClass(HINSTANCE hInstance)

-{

-	WNDCLASSEX wcex;

-

-	wcex.cbSize = sizeof(WNDCLASSEX);

-

-	wcex.style			= CS_HREDRAW | CS_VREDRAW;

-	wcex.lpfnWndProc	= WndProc;

-	wcex.cbClsExtra		= 0;

-	wcex.cbWndExtra		= 0;

-	wcex.hInstance		= hInstance;

-	wcex.hIcon			= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SAMPLEAPP));

-	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);

-	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);

-	wcex.lpszMenuName	= MAKEINTRESOURCE(IDC_SAMPLEAPP);

-	wcex.lpszClassName	= szWindowClass;

-	wcex.hIconSm		= LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

-

-	return RegisterClassEx(&wcex);

-}

-

-#include "SkOSWindow_Win.h"

-extern SkOSWindow* create_sk_window(void* hwnd);

-

-static SkOSWindow* gSkWind;

-

-//

-//   FUNCTION: InitInstance(HINSTANCE, int)

-//

-//   PURPOSE: Saves instance handle and creates main window

-//

-//   COMMENTS:

-//

-//        In this function, we save the instance handle in a global variable and

-//        create and display the main program window.

-//

-BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)

-{

-   HWND hWnd;

-

-   hInst = hInstance; // Store instance handle in our global variable

-

-   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,

-      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

-

-   if (!hWnd)

-   {

-      return FALSE;

-   }

-

-   gSkWind = create_sk_window(hWnd);

-

-   ShowWindow(hWnd, nCmdShow);

-   UpdateWindow(hWnd);

-

-   return TRUE;

-}

-

-//

-//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)

-//

-//  PURPOSE:  Processes messages for the main window.

-//

-//  WM_COMMAND	- process the application menu

-//  WM_PAINT	- Paint the main window

-//  WM_DESTROY	- post a quit message and return

-//

-//

-LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

-{

-	switch (message) {

-	case WM_COMMAND: {

-		int wmId    = LOWORD(wParam);

-		int wmEvent = HIWORD(wParam);

-		// Parse the menu selections:

-		switch (wmId) {

-			case IDM_ABOUT:

-				DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);

-				break;

-			case IDM_EXIT:

-				DestroyWindow(hWnd);

-				break;

-			default:

-				return DefWindowProc(hWnd, message, wParam, lParam);

-			}

-		} break;

-	case WM_DESTROY:

-		PostQuitMessage(0);

-		break;

-	default:

-		if (gSkWind->wndProc(hWnd, message, wParam, lParam)) {

-			return 0;

-		} else {

-			return DefWindowProc(hWnd, message, wParam, lParam);

-		}

-	}

-	return 0;

-}

-

-// Message handler for about box.

-INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)

-{

-	UNREFERENCED_PARAMETER(lParam);

-	switch (message)

-	{

-	case WM_INITDIALOG:

-		return (INT_PTR)TRUE;

-

-	case WM_COMMAND:

-		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)

-		{

-			EndDialog(hDlg, LOWORD(wParam));

-			return (INT_PTR)TRUE;

-		}

-		break;

-	}

-	return (INT_PTR)FALSE;

-}

diff --git a/xcode/sampleapp/SampleApp.xcodeproj/project.pbxproj b/xcode/sampleapp/SampleApp.xcodeproj/project.pbxproj
index 240e8b5..2d15ffc 100644
--- a/xcode/sampleapp/SampleApp.xcodeproj/project.pbxproj
+++ b/xcode/sampleapp/SampleApp.xcodeproj/project.pbxproj
@@ -17,7 +17,7 @@
 		00003C7A0EFC22CE000FF73A /* SkView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C710EFC22CE000FF73A /* SkView.cpp */; };
 		00003C7B0EFC22CE000FF73A /* SkViewPriv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C720EFC22CE000FF73A /* SkViewPriv.cpp */; };
 		00003C7C0EFC22CE000FF73A /* SkWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C730EFC22CE000FF73A /* SkWindow.cpp */; };
-		00003C810EFC22E1000FF73A /* skia_mac.cp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C7E0EFC22E1000FF73A /* skia_mac.cp */; };
+		00003C810EFC22E1000FF73A /* skia_mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C7E0EFC22E1000FF73A /* skia_mac.cpp */; };
 		00003C820EFC22E1000FF73A /* SkOSWindow_Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C7F0EFC22E1000FF73A /* SkOSWindow_Mac.cpp */; };
 		00003C950EFC2316000FF73A /* libeffects.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00003C940EFC230E000FF73A /* libeffects.a */; };
 		00003C9E0EFC233F000FF73A /* SkDOM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00003C9A0EFC233F000FF73A /* SkDOM.cpp */; };
@@ -243,7 +243,7 @@
 		00003C710EFC22CE000FF73A /* SkView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkView.cpp; path = ../../src/views/SkView.cpp; sourceTree = SOURCE_ROOT; };
 		00003C720EFC22CE000FF73A /* SkViewPriv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkViewPriv.cpp; path = ../../src/views/SkViewPriv.cpp; sourceTree = SOURCE_ROOT; };
 		00003C730EFC22CE000FF73A /* SkWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkWindow.cpp; path = ../../src/views/SkWindow.cpp; sourceTree = SOURCE_ROOT; };
-		00003C7E0EFC22E1000FF73A /* skia_mac.cp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = skia_mac.cp; path = ../../src/utils/mac/skia_mac.cp; sourceTree = SOURCE_ROOT; };
+		00003C7E0EFC22E1000FF73A /* skia_mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = skia_mac.cpp; path = ../../src/utils/mac/skia_mac.cpp; sourceTree = SOURCE_ROOT; };
 		00003C7F0EFC22E1000FF73A /* SkOSWindow_Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkOSWindow_Mac.cpp; path = ../../src/utils/mac/SkOSWindow_Mac.cpp; sourceTree = SOURCE_ROOT; };
 		00003C8C0EFC230E000FF73A /* effects.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = effects.xcodeproj; path = ../effects/effects.xcodeproj; sourceTree = SOURCE_ROOT; };
 		00003C9A0EFC233F000FF73A /* SkDOM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkDOM.cpp; path = ../../src/xml/SkDOM.cpp; sourceTree = SOURCE_ROOT; };
@@ -528,7 +528,7 @@
 				00003CA30EFC235F000FF73A /* SkXMLParser_empty.cpp */,
 				00003C9A0EFC233F000FF73A /* SkDOM.cpp */,
 				00003C9D0EFC233F000FF73A /* SkXMLParser.cpp */,
-				00003C7E0EFC22E1000FF73A /* skia_mac.cp */,
+				00003C7E0EFC22E1000FF73A /* skia_mac.cpp */,
 				00003C7F0EFC22E1000FF73A /* SkOSWindow_Mac.cpp */,
 				00003C6B0EFC22CE000FF73A /* SkEvent.cpp */,
 				00003C6C0EFC22CE000FF73A /* SkEventSink.cpp */,
@@ -919,7 +919,7 @@
 				00003C7A0EFC22CE000FF73A /* SkView.cpp in Sources */,
 				00003C7B0EFC22CE000FF73A /* SkViewPriv.cpp in Sources */,
 				00003C7C0EFC22CE000FF73A /* SkWindow.cpp in Sources */,
-				00003C810EFC22E1000FF73A /* skia_mac.cp in Sources */,
+				00003C810EFC22E1000FF73A /* skia_mac.cpp in Sources */,
 				00003C820EFC22E1000FF73A /* SkOSWindow_Mac.cpp in Sources */,
 				00003C9E0EFC233F000FF73A /* SkDOM.cpp in Sources */,
 				00003CA10EFC233F000FF73A /* SkXMLParser.cpp in Sources */,