aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
Commit message (Collapse)AuthorAge
* posix: Avoid static initializers in static/global mutexesGravatar digit@google.com2012-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes static initializers related to static and global mutexes from the final library's machine code when building on a pthread-capable system. We use PTHREAD_MUTEX_INITIALIZER to perform POD-style initialization. You need a line like the following to declare a global mutex with it: SkBaseMutex gMutex = { PTHREAD_MUTEX_INITIALIZER }; We introduce the SK_DECLARE_STATIC_MUTEX and SK_DECLARE_GLOBAL_MUTEX macros to be able to declare static/global mutexes in the source tree uniformly. SkMutex is now defined as a sub-class of SkBaseMutex, with standard construction/destruction semantics. This is useful if the mutex object is a member of another C++ class, or allocated dynamically. We also modify a few places to refer to SkBaseMutex instead of a SkMutex, where it makes sense. Generally speaking, client code should hold and use pointers to SkBaseMutex whenever they can now. We defined a new built-time macro named SK_USE_POSIX_THREADS to indicate that we're using a pthread-based SkThread.h interface. The macro will also be used in future patches to implement other helper thread synchronization classes. Finally, we inline the acquire() and release() functions in the case of Posix to improve performance a bit. Running: 'bench -repeat 10 -match mutex' on an Android device or a 2.4GHz Xeon Linux desktop shows the following improvements: Before After Galaxy Nexus 1.64 1.45 Nexus S 1.47 1.16 Xoom 1.86 1.66 Xeon 0.36 0.31 This removes 5 static mutex initializers from the library Review URL: https://codereview.appspot.com/5501066 git-svn-id: http://skia.googlecode.com/svn/trunk@3091 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix vertical bold text on macGravatar caryclark@google.com2012-01-25
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@3086 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove apparent SkIntToScalar(SkScalar) call in SkScalerContext_FreeTypeGravatar epoger@google.com2012-01-18
| | | | | | | | | | | This change seems to fix the following assertion failure we have been seeing in the Skia_Linux_Fixed_Debug build since http://code.google.com/p/skia/source/detail?r=3059 : drawing... bitmapfilters [540 330] ../include/core/SkFixed.h:67: failed assertion "n >= -32768 && n <= 32767" Review URL: https://codereview.appspot.com/5557049 git-svn-id: http://skia.googlecode.com/svn/trunk@3066 2bbb7eff-a529-9590-31e7-b0007b416f81
* add GenA8FromLCD as a hack to force GDI to create the A8 mask from the LCDGravatar reed@google.com2012-01-18
| | | | | | | | | results, rather than asking GDI directly for A8 (which it sometimes decides to interpret as BW) git-svn-id: http://skia.googlecode.com/svn/trunk@3061 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove unused bool param to SkMutex constructorGravatar reed@google.com2012-01-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3025 2bbb7eff-a529-9590-31e7-b0007b416f81
* android: optimize atomics routinesGravatar digit@google.com2012-01-11
| | | | | | | | | This patch provides a slightly optimized implementation of atomic increment/decrement functions by using static inlined versions of the gcc intrinsics. Review URL: http://codereview.appspot.com/5498069 git-svn-id: http://skia.googlecode.com/svn/trunk@3012 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change remaining ANDROID ifdefs to SK_BUILD_FOR_ANDROIDGravatar djsollen@google.com2012-01-09
| | | | | | Review URL: http://codereview.appspot.com/5528050 git-svn-id: http://skia.googlecode.com/svn/trunk@2990 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mac generateFontMetrics not converting to scalar.Gravatar bungeman@google.com2012-01-05
| | | | | | | http://codereview.appspot.com/5519045/ git-svn-id: http://skia.googlecode.com/svn/trunk@2979 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove attempt at subpixel handling from GDI font host.Gravatar bungeman@google.com2012-01-05
| | | | | | | http://codereview.appspot.com/5515046/ git-svn-id: http://skia.googlecode.com/svn/trunk@2976 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkDEBUGFAIL to clean up use of SkASSERT(!"text");Gravatar tomhudson@google.com2011-12-28
| | | | | | | | | | catch a couple of latent SkASSERT("text") bugs. http://codereview.appspot.com/5504090/ git-svn-id: http://skia.googlecode.com/svn/trunk@2926 2bbb7eff-a529-9590-31e7-b0007b416f81
* support vertical text and typeface-by-name on LeopardGravatar caryclark@google.com2011-12-21
| | | | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp M gyp/gmslides.gypi A gm/verttext2.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2920 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix vertical text on LionGravatar caryclark@google.com2011-12-20
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2906 2bbb7eff-a529-9590-31e7-b0007b416f81
* partial fix for vertical text on LionGravatar caryclark@google.com2011-12-19
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2896 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional manual global initializationGravatar caryclark@google.com2011-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | M include/effects/SkAvoidXfermode.h M include/effects/SkDiscretePathEffect.h M include/effects/Sk1DPathEffect.h M include/effects/Sk2DPathEffect.h M include/effects/SkBlurDrawLooper.h M include/effects/SkPixelXorXfermode.h M include/effects/SkDashPathEffect.h M include/effects/SkColorMatrixFilter.h M include/effects/SkEmbossMaskFilter.h M include/effects/SkLayerDrawLooper.h M include/effects/SkGroupShape.h M include/effects/SkBlurImageFilter.h M include/effects/SkRectShape.h A include/effects/SkEffects.h M include/effects/SkCornerPathEffect.h M include/effects/SkGradientShader.h M include/effects/SkBlurMaskFilter.h M include/effects/SkLayerRasterizer.h M include/core/SkMallocPixelRef.h M include/core/SkFlattenable.h M include/core/SkShape.h M include/core/SkPixelRef.h M include/core/SkGraphics.h M include/core/SkPathEffect.h M include/core/SkPostConfig.h M include/core/SkXfermode.h M include/core/SkColorFilter.h M include/images/SkFlipPixelRef.h M include/images/SkImageRef_GlobalPool.h M src/effects/SkDashPathEffect.cpp M src/effects/SkColorMatrixFilter.cpp M src/effects/SkBlurImageFilter.cpp M src/effects/SkGroupShape.cpp M src/effects/SkCornerPathEffect.cpp M src/effects/SkGradientShader.cpp M src/effects/SkBlurMaskFilter.cpp M src/effects/SkAvoidXfermode.cpp M src/effects/Sk2DPathEffect.cpp M src/effects/SkBlurDrawLooper.cpp M src/effects/SkPixelXorXfermode.cpp M src/effects/SkColorFilters.cpp M src/effects/SkLayerDrawLooper.cpp M src/effects/SkRectShape.cpp A src/effects/SkEffects.cpp M src/effects/SkLayerRasterizer.cpp M src/effects/SkDiscretePathEffect.cpp M src/effects/Sk1DPathEffect.cpp A src/effects/SkEffects_none.cpp M src/core/SkPixelRef.cpp M src/core/SkGraphics.cpp M src/core/SkFlattenable.cpp M src/core/SkBitmapProcShader.h M src/core/SkPathEffect.cpp M src/core/SkShape.cpp M src/core/SkXfermode.cpp M src/core/SkMallocPixelRef.cpp M src/core/SkBitmapProcShader.cpp M src/images/SkFlipPixelRef.cpp M src/images/SkImageRef_GlobalPool.cpp A src/ports/SkGlobalInitialization_chromium.cpp M src/ports/SkImageRef_ashmem.h M src/ports/SkImageRef_ashmem.cpp A src/ports/SkGlobalInitialization_default.cpp M gyp/effects.gyp M gyp/tools.gyp M gyp/ports.gyp git-svn-id: http://skia.googlecode.com/svn/trunk@2876 2bbb7eff-a529-9590-31e7-b0007b416f81
* move variable declarations above goto lines, to fix warning/error aboutGravatar reed@google.com2011-11-28
| | | | | | | | skipping over them. git-svn-id: http://skia.googlecode.com/svn/trunk@2750 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove obsolete assertGravatar reed@google.com2011-11-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2734 2bbb7eff-a529-9590-31e7-b0007b416f81
* store 3 bits of luminance, but (for now) discretize that in fonthost::filterecGravatar reed@google.com2011-11-22
| | | | | | | | for backward compatibility git-svn-id: http://skia.googlecode.com/svn/trunk@2732 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove GetGammaFlag from SkFontHostGravatar reed@google.com2011-11-22
| | | | | | | | prep for retooling of gamma support git-svn-id: http://skia.googlecode.com/svn/trunk@2730 2bbb7eff-a529-9590-31e7-b0007b416f81
* reorder bits and remove obsolete kForceAA experimental bitGravatar reed@google.com2011-11-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2725 2bbb7eff-a529-9590-31e7-b0007b416f81
* only call FT_Get_Advance if we really want linear metricsGravatar reed@google.com2011-11-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2721 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove all references to SkGlobals (obsolete)Gravatar reed@google.com2011-11-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2713 2bbb7eff-a529-9590-31e7-b0007b416f81
* pass font size explicitly for leopardGravatar caryclark@google.com2011-11-16
| | | | | | | | | | http://codereview.appspot.com/5401043/ M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2700 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add support in Android for AdvancedTypefaceMetricsGravatar djsollen@google.com2011-11-16
| | | | | | Review URL: http://codereview.appspot.com/5396045 git-svn-id: http://skia.googlecode.com/svn/trunk@2698 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix broken Android build.Gravatar djsollen@google.com2011-11-16
| | | | | | reviewed by reed. git-svn-id: http://skia.googlecode.com/svn/trunk@2697 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove unneeded include which is breaking build.Gravatar bungeman@google.com2011-11-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2694 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add paging support for handle based typefaces.Gravatar bungeman@google.com2011-11-15
| | | | | | | | http://codereview.appspot.com/5379043/ http://codereview.appspot.com/5364052/ git-svn-id: http://skia.googlecode.com/svn/trunk@2693 2bbb7eff-a529-9590-31e7-b0007b416f81
* suppress warnings on clangGravatar caryclark@google.com2011-11-14
| | | | | | | | | | http://codereview.appspot.com/5372101 M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2683 2bbb7eff-a529-9590-31e7-b0007b416f81
* check for null on LionGravatar caryclark@google.com2011-11-14
| | | | | | | | | | http://codereview.appspot.com/5369107/ M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2674 2bbb7eff-a529-9590-31e7-b0007b416f81
* add vertical text support in mac portGravatar caryclark@google.com2011-11-10
| | | | | | | | | | http://codereview.appspot.com/5375053 M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2659 2bbb7eff-a529-9590-31e7-b0007b416f81
* add vertical-text bit to paint (not supported yet)Gravatar reed@google.com2011-11-10
| | | | | | | | check-point for using freetype on mac (not enabled yet) git-svn-id: http://skia.googlecode.com/svn/trunk@2657 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove common fields from Offscreen utility classGravatar caryclark@google.com2011-11-10
| | | | | | | | | | http://codereview.appspot.com/5373046/ M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2652 2bbb7eff-a529-9590-31e7-b0007b416f81
* change m to fGravatar caryclark@google.com2011-11-09
| | | | | | | | | | http://codereview.appspot.com/5376043/ M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2650 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleanup for the Android build.Gravatar djsollen@google.com2011-11-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2630 2bbb7eff-a529-9590-31e7-b0007b416f81
* add api to SkGraphics to get/set font cache limitGravatar reed@google.com2011-11-08
| | | | | | | | add SK_DEFAULT_FONT_CACHE_LIMIT to SkUserConfig, to override our default value git-svn-id: http://skia.googlecode.com/svn/trunk@2621 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add font scaler gm.Gravatar bungeman@google.com2011-11-04
| | | | | | | http://codereview.appspot.com/5337044/ git-svn-id: http://skia.googlecode.com/svn/trunk@2603 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update the Skia gyp files to use the external android sources.Gravatar djsollen@google.com2011-11-03
| | | | | | Review URL: http://codereview.appspot.com/5336048 git-svn-id: http://skia.googlecode.com/svn/trunk@2598 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert accidental change to lcd format prefGravatar reed@google.com2011-11-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2596 2bbb7eff-a529-9590-31e7-b0007b416f81
* create inline versions of common CGRect functions, since they appeared onGravatar reed@google.com2011-11-03
| | | | | | | | our profile of FontScalerBench git-svn-id: http://skia.googlecode.com/svn/trunk@2595 2bbb7eff-a529-9590-31e7-b0007b416f81
* custom memset32 to speed up erasing the offscreen when its width is small.Gravatar reed@google.com2011-11-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2594 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding support to trunk for building Skia using the Android NDK.Gravatar djsollen@google.com2011-11-03
| | | | | | | | | | This CL depends on a subsequent CL to add the appropriate NDK toolchain and system sources to the skia repo. Review URL: http://codereview.appspot.com/5306089/ Review URL: http://codereview.appspot.com/5306089 git-svn-id: http://skia.googlecode.com/svn/trunk@2592 2bbb7eff-a529-9590-31e7-b0007b416f81
* speed up font cache creation (20x using FontScalerBench)Gravatar reed@google.com2011-11-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2591 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix font id calculationGravatar caryclark@google.com2011-11-02
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2583 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix monospace glyph bounds on LionGravatar caryclark@google.com2011-11-01
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2578 2bbb7eff-a529-9590-31e7-b0007b416f81
* Don't use LCD on grayscale devices.Gravatar caryclark@google.com2011-10-25
| | | | | | | | | | http://codereview.appspot.com/5281041 M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2528 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix Leopard glyph boundsGravatar caryclark@google.com2011-10-25
| | | | | | | | M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2525 2bbb7eff-a529-9590-31e7-b0007b416f81
* add support for local fontsGravatar caryclark@google.com2011-10-25
| | | | | | | | | | http://codereview.appspot.com/5295052/ M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2523 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove duplicate GetFontStyle from SkFontHost_win.Gravatar bungeman@google.com2011-10-24
| | | | | | | http://codereview.appspot.com/5306058/ git-svn-id: http://skia.googlecode.com/svn/trunk@2522 2bbb7eff-a529-9590-31e7-b0007b416f81
* Just use ExtTextOutW for glyphs.Gravatar bungeman@google.com2011-10-20
| | | | | | | http://codereview.appspot.com/5308047/ git-svn-id: http://skia.googlecode.com/svn/trunk@2512 2bbb7eff-a529-9590-31e7-b0007b416f81
* use ATSFontRef for our unique ID. Much more stable than using the ptr itself ↵Gravatar reed@google.com2011-10-11
| | | | | | (duh) git-svn-id: http://skia.googlecode.com/svn/trunk@2457 2bbb7eff-a529-9590-31e7-b0007b416f81
* bug fix for character 0x200B : zero-advance-spaceGravatar reed@google.com2011-10-06
| | | | | | | | | | | | | If we see a zero-advance, double check to see if its bounds should really be empty, by asking for its path. If that is empty, jam the bounds to 0 The bug was that CT was returning a huge bounds for that character (but, strangely enough, not for normal space character, hence our check for zero-advance) git-svn-id: http://skia.googlecode.com/svn/trunk@2424 2bbb7eff-a529-9590-31e7-b0007b416f81