diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 22:54:10 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 22:54:10 +0000 |
commit | 077bf89f7c5934cd90ccdb21f3d96bda665ba182 (patch) | |
tree | ea31aea27e548fa609ade454f38540875027d3b4 /skia | |
parent | 099334476813e112dc12f912b89718fdef2cc384 (diff) | |
download | chromium_src-077bf89f7c5934cd90ccdb21f3d96bda665ba182.zip chromium_src-077bf89f7c5934cd90ccdb21f3d96bda665ba182.tar.gz chromium_src-077bf89f7c5934cd90ccdb21f3d96bda665ba182.tar.bz2 |
Get chrome's skia project building on mac
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/Skia_Prefix.pch | 42 | ||||
-rw-r--r-- | skia/corecg/SkMatrix.cpp | 7 | ||||
-rw-r--r-- | skia/include/corecg/SkUserConfig.h | 27 | ||||
-rw-r--r-- | skia/ports/SkFontHost_none.cpp | 10 |
4 files changed, 80 insertions, 6 deletions
diff --git a/skia/Skia_Prefix.pch b/skia/Skia_Prefix.pch new file mode 100644 index 0000000..07a6ebf --- /dev/null +++ b/skia/Skia_Prefix.pch @@ -0,0 +1,42 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Copied from base/basictypes.h with some modifications +// + +// Prefix header for all source files in the 'Skia' framework. +// + +#ifdef __OBJC__ +#import <Cocoa/Cocoa.h> +#endif + +#define SK_BUILD_FOR_MAC + +// include the Skia prefix file +#include "precompiled.cc" diff --git a/skia/corecg/SkMatrix.cpp b/skia/corecg/SkMatrix.cpp index 78f6688..d5b64ec 100644 --- a/skia/corecg/SkMatrix.cpp +++ b/skia/corecg/SkMatrix.cpp @@ -1574,6 +1574,11 @@ bool SkMatrix::setPolyToPoly(const SkPoint src[], const SkPoint dst[], /////////////////////////////////////////////////////////////////////////////// void SkMatrix::dump() const { +// Note: We don't use this so it's #if 0'd out. If turned back on, there +// is an #ifdef parsing difference between gcc and msvc where msvc incorrectly +// allows a missing #endif. Attempts to reconcile proved unfruitful thus we +// just turned it off. +#if 0 // ensure the fTypeMask is up2date (void)this->getType(); #ifdef SK_DEBUG @@ -1592,6 +1597,8 @@ void SkMatrix::dump() const { SkFractToFloat(fMat[6]), SkFractToFloat(fMat[7]), SkFractToFloat(fMat[8]), fTypeMask); #endif +#endif +#endif } /////////////////////////////////////////////////////////////////////////////// diff --git a/skia/include/corecg/SkUserConfig.h b/skia/include/corecg/SkUserConfig.h index be7622f..a9d4fea 100644 --- a/skia/include/corecg/SkUserConfig.h +++ b/skia/include/corecg/SkUserConfig.h @@ -86,6 +86,8 @@ #define SK_SCALAR_IS_FLOAT #undef SK_SCALAR_IS_FIXED +#if defined(SK_BUILD_FOR_WIN32) + #define SK_BUILD_FOR_WIN // VC8 doesn't support stdint.h, so we define those types here. @@ -96,6 +98,25 @@ typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned uint32_t; +#define SK_A32_SHIFT 24 +#define SK_R32_SHIFT 16 +#define SK_G32_SHIFT 8 +#define SK_B32_SHIFT 0 + +// Skia uses this deprecated bzero function to fill zeros into a string. +#define bzero(str, len) memset(str, 0, len) + +#elif defined(SK_BUILD_FOR_MAC) + +#define SK_CPU_LENDIAN +#undef SK_CPU_BENDIAN +// we want (memory order) RGBA +#define SK_A32_SHIFT 24 +#define SK_R32_SHIFT 0 +#define SK_G32_SHIFT 8 +#define SK_B32_SHIFT 16 + +#endif // Don't use skia debug mode even when compiled as debug, because we don't // care about debugging this library, only our app. @@ -104,13 +125,7 @@ typedef unsigned uint32_t; #define SK_RELEASE #undef SK_RESTRICT #define SK_RESTRICT -// Skia uses this deprecated bzero function to fill zeros into a string. -#define bzero(str, len) memset(str, 0, len) #define SkDebugf(...) ((void)0) -#define SK_A32_SHIFT 24 -#define SK_R32_SHIFT 16 -#define SK_G32_SHIFT 8 -#define SK_B32_SHIFT 0 // ===== End Chrome-specific definitions ===== diff --git a/skia/ports/SkFontHost_none.cpp b/skia/ports/SkFontHost_none.cpp index 90bd063..4e75abc 100644 --- a/skia/ports/SkFontHost_none.cpp +++ b/skia/ports/SkFontHost_none.cpp @@ -78,3 +78,13 @@ void SkFontHost::GetGammaTables(const uint8_t* tables[2]) tables[1] = NULL; // white gamma (e.g. exp= 1/1.4) } +/////////////////////////////////////////////////////////////////////////////// + +SkTypeface* SkFontHost::Deserialize(SkStream* stream) { + SkASSERT(!"SkFontHost::Deserialize unimplemented"); + return NULL; +} + +void SkFontHost::Serialize(const SkTypeface*, SkWStream*) { + SkASSERT(!"SkFontHost::Serialize unimplemented"); +} |