aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
Commit message (Collapse)AuthorAge
* Split atomic and mutex implementations and make inlinable.Gravatar bungeman@google.com2013-12-18
| | | | | | | | | | | | | | | | | | | | | | | Skia cannot use Chromium's implementation of mutex (Lock) due to static initializers. However, we would like to be able to use Chromium's implementation of atomics. This motivates the split of implementation. Skia's atomic and mutex calls should be inlinable, especially the atomics. These calls often compile down to very few instructions, and we currently have the overhead of a function call. This motivates the header implementation. There is still a desire for the build system to select the implementation, so the SK_XXX_PLATFORM_H pattern for header files is introduced. This allows the build system to control which platform specific header files are chosen. The Chromium side changes (most of which will need to go in before this change can be found at https://codereview.chromium.org/19477005/ . The Chromium side changes after this lands can be seen at https://codereview.chromium.org/98073013 . Review URL: https://codereview.chromium.org/19808007 git-svn-id: http://skia.googlecode.com/svn/trunk@12738 2bbb7eff-a529-9590-31e7-b0007b416f81
* deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. ↵Gravatar reed@google.com2013-12-17
| | | | | | | | | | | #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/111353003 git-svn-id: http://skia.googlecode.com/svn/trunk@12719 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floatsGravatar reed@google.com2013-12-17
| | | | | | | | | | | | | To keep the CL (slightly) managable, this does not make any changes to existing macros (e.g. SkScalarMul). Just tackling #ifdef constructs this time around. BUG= R=bsalomon@google.com, caryclark@google.com Review URL: https://codereview.chromium.org/117053002 git-svn-id: http://skia.googlecode.com/svn/trunk@12712 2bbb7eff-a529-9590-31e7-b0007b416f81
* Supports the cap height for FreeType even when TT OS2 version is 1.Gravatar bungeman@google.com2013-12-16
| | | | | | | | | BUG=http://crbug.com/318645 R=bungeman@google.com, reed@google.com Review URL: https://codereview.chromium.org/101333004 git-svn-id: http://skia.googlecode.com/svn/trunk@12689 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix some presubmit warnings.Gravatar tfarina@chromium.org2013-12-14
| | | | | | | | | | | | | | | | | | | | | | | | I found this while running a modified version of v8's tools/presubmit.py script. samplecode/SampleImage.cpp does not end with a single new line. samplecode/SampleImageDir.cpp does not end with a single new line. src/ports/SkFontHost_sandbox_none.cpp does not end with a single new line. tests/FlatDataTest.cpp does not end with a single new line. tests/ImageCacheTest.cpp has trailing whitespaces in line 31. * Removed three empty files. * Add single new line to FlatDataTest.cpp * Removed trailing whitespace in ImageCacheTest.cpp BUG=None TEST=None R=bsalomon@google.com TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/111503008 git-svn-id: http://skia.googlecode.com/svn/trunk@12684 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12617 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkAshmemDiscardableMemoryGravatar halcanary@google.com2013-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | - Implement ashmem-backed SkDiscardableMemory subclass: This class in only accesible via the SkDiscardableMemory::Create() function, which replaces the mock implementation in SkDiscardableMemory_none.cpp - Added SkDiscardableMemory_ashmem.cpp to the Android port of Skia Removed SkDiscardableMemory_none.cpp from the Android port. - Added DiscardableMemoryTest. Still needs work. - SkDiscardablePixelRef Bugfix: onLockPixels() now calls SkDELETE on the SkDiscardableMemory pointer when it fails to unlock. - Improved documentation inside ashmem.h BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/83563002 git-svn-id: http://skia.googlecode.com/svn/trunk@12608 2bbb7eff-a529-9590-31e7-b0007b416f81
* improve bitmap font support (FreeType only)Gravatar bungeman@google.com2013-12-10
| | | | | | | | | | | | | | | This commit improves SkFontHost_FreeType's support for bitmap fonts, adding a number of features: - Intelligent bitmap strike selection. - Inter-strike bitmap font scaling. - Colour bitmap font support (FreeType 2.5.0+). BUG= R=reed@google.com Review URL: https://codereview.chromium.org/23684041 git-svn-id: http://skia.googlecode.com/svn/trunk@12607 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of https://codereview.chromium.org/111853003/Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | | | | Reason for revert: Was not the culprit. R=bungeman@google.com, reed@google.com TBR=bungeman@google.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: mtklein@google.com Review URL: https://codereview.chromium.org/102243009 git-svn-id: http://skia.googlecode.com/svn/trunk@12606 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "[PDF] Fix font embedding restrictions."Gravatar vandebo@chromium.org2013-12-10
| | | | | | | | This reverts r12600 and r12601, likely causing crash on Mac. Review URL: https://codereview.chromium.org/111893002 git-svn-id: http://skia.googlecode.com/svn/trunk@12604 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of https://codereview.chromium.org/109033002/Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | | | | Reason for revert: I suspect this is causing GM to crash on Mac. R=bungeman@google.com, reed@google.com TBR=bungeman@google.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: mtklein@google.com Review URL: https://codereview.chromium.org/111853003 git-svn-id: http://skia.googlecode.com/svn/trunk@12603 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix missing ; in win code.Gravatar vandebo@chromium.org2013-12-10
| | | | | | Review URL: https://codereview.chromium.org/104533005 git-svn-id: http://skia.googlecode.com/svn/trunk@12601 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix font embedding restrictions.Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | Stop using restricted font outlines and honor don't subset restriction. R=reed@google.com, bungeman@google.com Author: vandebo@chromium.org Review URL: https://codereview.chromium.org/107863002 git-svn-id: http://skia.googlecode.com/svn/trunk@12600 2bbb7eff-a529-9590-31e7-b0007b416f81
* Shut up the CoreText performance note.Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | | | | Aped from https://codereview.qt-project.org/70097 Please keep in mind: https://www.google.com/search?q=i+have+no+idea+what+i'm+doing+dog&tbm=isch BUG= R=bungeman@google.com, reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/109033002 git-svn-id: http://skia.googlecode.com/svn/trunk@12599 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix one too many levels of indirection introduced in 12573.Gravatar bungeman@google.com2013-12-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12577 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix threading issue in DirectWrite port initialization.Gravatar bungeman@google.com2013-12-09
| | | | | | | | | | | | The DirectWrite port maintains a global instance of an IDWriteFactory, which is used to create all other DirectWrite objects. However, the initialization of this object is not currently thread safe. R=caryclark@google.com Review URL: https://codereview.chromium.org/107963003 git-svn-id: http://skia.googlecode.com/svn/trunk@12573 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkDecodingImageGenerator now uses SkStreamRewindableGravatar halcanary@google.com2013-12-09
| | | | | | | | | | | | | | | | | | This makes sense since Android will be giving us a stream and the decoders expect a stream. This also removes some glue code, DecodeMemoryToTarget, that works better using a SkImageGenerator. Motivation: This is a necessary step to move from SkImageRef to SkDiscardablePixelRef. SkImageDecoder::DecodeMemoryToTarget function removed. BUG= R=reed@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/101973005 git-svn-id: http://skia.googlecode.com/svn/trunk@12560 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix change src/ports/SkImageDecoder_empty.cpp missed in 103033002Gravatar halcanary@google.com2013-12-05
| | | | | | | | | BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/107123002 git-svn-id: http://skia.googlecode.com/svn/trunk@12519 2bbb7eff-a529-9590-31e7-b0007b416f81
* Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCacheGravatar halcanary@google.com2013-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed SkBitmapFactory since no clients were using it. New cache selection mechanism can simply pass a SkDiscardableMemory::Factory into the SkDiscardablePixelRef if non-default SkDiscardableMemory should be used. Removed BitmapFactoryTest. SkDiscardableMemory::Factory interface. Android will need this functionality in the future inside their BitmapFactory. Removed SkLazyPixelRef, since it's functionality is now subsumed into SkDiscardablePixelRef. Removed LazyPixelRef test. Modified SkDiscardablePixelRef to optionally allow it to use a SkDiscardableMemory::Factory. This tiny change makes it a replacement for SkLazyPixelRef. This functioanlity is also necessary for moving Android over to SkDiscardablePixelRef from SkImageRef in a later CL. Added a test for this. SkDecodingImageGenerator::Install can optionally pass a factory in to SkDiscardablePixelRef. Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache. This functionality can be handled much more cleanly by SkDiscardableMemory. New SkDiscardableMemoryPool class to replace SkLruImageCache. In a later CL, we will replace SkImageRef_GlobalPool (used by android) as well. This is a concrete implementation of SkDiscardableMemory::Factory. Added a test for this. modified gm/factory.cpp to remove dependnce on SkBitmapFactory + SkLruImageCache. Now uses SkDecodingImageGenerator + SkDiscardablePixelRef + SkDiscardableMemoryPool. SkImageDecoder::Target replaces SkBitmapFactory::Target. The DecodeMemoryToTarget function may disappear in the future. Moved SkLazyCachingPixelRef::DecodeProc replaces SkBitmapFactory::DecodeProc. This is a short term change, since another CL changes SkLazyCachingPixelRef to use SkImageGenerator instead of DecodeProc. Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of SkLazyPixelRef. tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator + SkDiscardablePixelRef instead of a SkBitmapFactory. bench_pictures uses the Global SkDiscardableMemoryPool instead of a global gLruImageCache. R=reed@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/103033002 git-svn-id: http://skia.googlecode.com/svn/trunk@12515 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use lowercase windows.h in includes to fix Windows cross compilation using ↵Gravatar bungeman@google.com2013-12-03
| | | | | | | | | | | | mingw. While it doesn't matter on Windows, mingw on case-sensitive OSes uses all lower case filenames for platform include files. I found the problem in SkCondVar.h from Mozilla checkout of skia sources, but the patch contains a fix for the whole skia tree. R=bungeman@google.com Review URL: https://codereview.chromium.org/99173003 git-svn-id: http://skia.googlecode.com/svn/trunk@12461 2bbb7eff-a529-9590-31e7-b0007b416f81
* Actually mark other types of fonts as 'kOther' in FreeType port.Gravatar bungeman@google.com2013-12-02
| | | | | | | | | Without this, the fType is garbage and will most likely cause an assert or unwanted behavior later. Review URL: https://codereview.chromium.org/99453005 git-svn-id: http://skia.googlecode.com/svn/trunk@12431 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove unwanted gFTMutex from DirectWrite port.Gravatar bungeman@google.com2013-11-21
| | | | | | | | | | | | This mutex exists because this file started life as a copy of the FreeType port. There is no global library state to protect here, so there is no need for the mutex. R=caryclark@google.com Review URL: https://codereview.chromium.org/80983003 git-svn-id: http://skia.googlecode.com/svn/trunk@12353 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkImageGenerator InterfaceGravatar halcanary@google.com2013-11-21
| | | | | | | | | | | | | | | | | | - Add SkDiscardablePixelRef class that uses SkDiscardableMemory and a SkImageGenerator. - Add SkDecodingImageGenerator class as an example of a SkImageGenerator. - Add DecodingImageGenerator unit test. - Add SkBasicDiscardableMemory implmentation for unit tests only. R=reed@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/74793011 git-svn-id: http://skia.googlecode.com/svn/trunk@12341 2bbb7eff-a529-9590-31e7-b0007b416f81
* Only SkFontMgr_New_DirectWrite should call GetSystemFontCollection.Gravatar bungeman@google.com2013-11-20
| | | | | | | | | | | | Aside from the factory helper, there should be no calls to IDWriteFactory::GetSystemFontCollection. All other code should work in terms of IDWriteFontCollection for flexibility and correctness. R=caryclark@google.com Review URL: https://codereview.chromium.org/77023006 git-svn-id: http://skia.googlecode.com/svn/trunk@12331 2bbb7eff-a529-9590-31e7-b0007b416f81
* De-generalize create_typeface on Windows.Gravatar bungeman@google.com2013-11-20
| | | | | | | | | | | | The gdi and dw backends have a local create_typeface function. This function is now called in only one place, onLegacyCreateTypeface. Move the implementation into the caller. R=caryclark@google.com Review URL: https://codereview.chromium.org/76763002 git-svn-id: http://skia.googlecode.com/svn/trunk@12313 2bbb7eff-a529-9590-31e7-b0007b416f81
* Guard against most unintentionally ephemeral SkAutoFoo instantiations.Gravatar commit-bot@chromium.org2013-11-18
| | | | | | | | | | | | | | | | | | | I think I applied the trick everywhere possible. Limitations: - can't be used with templated classes - all constructors and destructors must be defined inline A couple of the SkAutoFoo were unused in Skia, Chromium, and Android, so I deleted them. This change caught the same bugs Cary found in SkPath, plus one more in SampleApp. BUG= R=reed@google.com, caryclark@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/72603005 git-svn-id: http://skia.googlecode.com/svn/trunk@12301 2bbb7eff-a529-9590-31e7-b0007b416f81
* Android FontHost cannot use FontMgr yet.Gravatar bungeman@google.com2013-11-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12221 2bbb7eff-a529-9590-31e7-b0007b416f81
* Give Android a SkFontMgr::Factory which was missing as of r12217.Gravatar bungeman@google.com2013-11-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12220 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_FONTHOST_USES_FONTMGR.Gravatar bungeman@google.com2013-11-11
| | | | | | Review URL: https://codereview.chromium.org/66783003 git-svn-id: http://skia.googlecode.com/svn/trunk@12217 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding error checks to SkRBufferGravatar commit-bot@chromium.org2013-11-08
| | | | | | | | | | | BUG= R=robertphillips@google.com, bsalomon@google.com, reed@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/61913002 git-svn-id: http://skia.googlecode.com/svn/trunk@12202 2bbb7eff-a529-9590-31e7-b0007b416f81
* move SkImage::ColorType into SkColorTypeGravatar reed@google.com2013-11-01
| | | | | | | | | | | | | | | | | | objective -- move clients over to SkImage tasks - use SkImageInfo instead of SkBitmap::Config - add support for colortables to SkImage - add drawImage to SkCanvas - return SkImage from readPixels This CL works towards the first task R=robertphillips@google.com Review URL: https://codereview.chromium.org/54363008 git-svn-id: http://skia.googlecode.com/svn/trunk@12077 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | | since it triggers a warning"" This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d. BUG= Review URL: https://codereview.chromium.org/54603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it ↵Gravatar reed@google.com2013-10-31
| | | | | | | | triggers a warning" This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | a warning BUG= R=robertphillips@google.com, senorblanco@chromium.org, vandebo@chromium.org Review URL: https://codereview.chromium.org/51033004 git-svn-id: http://skia.googlecode.com/svn/trunk@12055 2bbb7eff-a529-9590-31e7-b0007b416f81
* prototype for kerning apiGravatar reed@google.com2013-10-30
| | | | | | | | | BUG= R=bungeman@google.com Review URL: https://codereview.chromium.org/29363009 git-svn-id: http://skia.googlecode.com/svn/trunk@12018 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-10-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11969 2bbb7eff-a529-9590-31e7-b0007b416f81
* onCharsToGlyphs to handle non-bmp on Mac.Gravatar bungeman@google.com2013-10-25
| | | | | | | | | | CTFontGetGlyphsForCharacters is a strange API for non-bmp code points. R=caryclark@google.com Review URL: https://codereview.chromium.org/43463005 git-svn-id: http://skia.googlecode.com/svn/trunk@11965 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix non-bmp in generateCharToGlyph on Mac.Gravatar bungeman@google.com2013-10-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11957 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add missing braces for r11955.Gravatar bungeman@google.com2013-10-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11956 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement charToGlyph on remaining ports.Gravatar bungeman@google.com2013-10-24
| | | | | | | | R=reed@google.com Review URL: https://codereview.chromium.org/22859070 git-svn-id: http://skia.googlecode.com/svn/trunk@11955 2bbb7eff-a529-9590-31e7-b0007b416f81
* Initial error handling codeGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | I made it as simple as possible. The impact seems minimal and it should do what's necessary to make this code secure. BUG= Committed: http://code.google.com/p/skia/source/detail?r=11247 R=reed@google.com, scroggo@google.com, djsollen@google.com, sugoi@google.com, bsalomon@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/23021015 git-svn-id: http://skia.googlecode.com/svn/trunk@11922 2bbb7eff-a529-9590-31e7-b0007b416f81
* scope ComputeIsOpaque with SkBitmapGravatar reed@google.com2013-10-21
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/32653002 git-svn-id: http://skia.googlecode.com/svn/trunk@11879 2bbb7eff-a529-9590-31e7-b0007b416f81
* store SkAlphaType inside SkBitmap, on road to support unpremulGravatar reed@google.com2013-10-21
| | | | | | | | | BUG= R=bsalomon@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/25275004 git-svn-id: http://skia.googlecode.com/svn/trunk@11877 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkColorTable from SkFlattenable hierarchy.Gravatar commit-bot@chromium.org2013-10-15
| | | | | | | | | | | BUG= R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/27392002 git-svn-id: http://skia.googlecode.com/svn/trunk@11791 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix off by one error in last advanceCount in SkFontHost_FreeType.Gravatar bungeman@google.com2013-10-15
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/27338003 git-svn-id: http://skia.googlecode.com/svn/trunk@11781 2bbb7eff-a529-9590-31e7-b0007b416f81
* Second wave of Win64 warning cleanupGravatar robertphillips@google.com2013-10-15
| | | | | | | | https://codereview.chromium.org/27343002/ git-svn-id: http://skia.googlecode.com/svn/trunk@11778 2bbb7eff-a529-9590-31e7-b0007b416f81
* Start cleaning up 64bit Win warningsGravatar robertphillips@google.com2013-10-14
| | | | | | | | https://codereview.chromium.org/27192003/ git-svn-id: http://skia.googlecode.com/svn/trunk@11764 2bbb7eff-a529-9590-31e7-b0007b416f81
* change SkAnnotation to not inherit from SkFlattenable (does not need dynamic ↵Gravatar reed@google.com2013-10-14
| | | | | | | | | | | factories) BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/26606004 git-svn-id: http://skia.googlecode.com/svn/trunk@11762 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkDataSet, and just store a key/value in SkAnnotationGravatar reed@google.com2013-10-14
| | | | | | | | | BUG= R=mtklein@google.com Review URL: https://codereview.chromium.org/27208002 git-svn-id: http://skia.googlecode.com/svn/trunk@11759 2bbb7eff-a529-9590-31e7-b0007b416f81