aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/win
Commit message (Collapse)AuthorAge
* Move headers in include/utils/win to src/utils/win.Gravatar bungeman2016-06-16
| | | | | | These headers are not intended for external use and are only used in src. Review-Url: https://codereview.chromium.org/2070983002
* A Mozilla developer ran the µmix static analyzer on its codebase and ↵Gravatar lsalzman2016-06-07
| | | | | | | | | | | incidentally found some issues regarding null checks in Skia. This fixes the issues that were found. Downstream bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1278452 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046563007 Review-Url: https://codereview.chromium.org/2046563007
* SkLeanWindows.h: #include "Windows.h" fewer placesGravatar halcanary2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | $ git grep -l '<windows.h>' include src include/private/SkLeanWindows.h $ git grep -l SkLeanWindows.h | grep '\.h$' include/ports/SkTypeface_win.h include/utils/win/SkHRESULT.h include/utils/win/SkTScopedComPtr.h include/views/SkEvent.h src/core/SkMathPriv.h src/ports/SkTypeface_win_dw.h src/utils/SkThreadUtils_win.h src/utils/win/SkWGL.h The same for `#include <intrin.h>` that was found in SkMath.h. Those functions that needed it are moved to SkMathPriv.h. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041943002 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng Review-Url: https://codereview.chromium.org/2041943002
* Added --deepColor option to SampleApp, triggers creation of a ten-bit/channelGravatar brianosman2016-05-05
| | | | | | | | | | buffer. (Only on Windows at the moment). Uses new effect to do the final gamma adjustment BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919993002 Review-Url: https://codereview.chromium.org/1919993002
* Add oblique as a slant.Gravatar bungeman2016-04-27
| | | | | | | | | | | | | Some fonts have italic and oblique in the same family, see http://lucidafonts.com/fonts/family/lucida-sans http://www.gust.org.pl/projects/e-foundry/latin-modern GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1921903002 Chromium side change at https://crrev.com/1921503006/ . Review-Url: https://codereview.chromium.org/1921903002
* Modernize and trim down SkOnce.Gravatar mtklein2016-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | The API and implementation are very much simplified. You may not want to bother reading the diff. As is our trend, SkOnce now uses <atomic> directly. Member initialization means we don't need SK_DECLARE_STATIC_ONCE. SkSpinlock already works this same way. All uses of the old API taking an external bool* and Lock* were pessimal, so I have not carried this sort of API forward. It's simpler, faster, and more space-efficient to always use this single SkOnce class interface. SkOnce weighs 2 bytes: a done bool and an SkSpinlock, also a bool internally. This API refactoring opens up the opportunity to fuse those into a single three-state byte if we'd like. No public API changes. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1894893002 Review URL: https://codereview.chromium.org/1894893002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* detach -> releaseGravatar mtklein2016-03-16
| | | | | | | | | | | | | The C++ standard library uses the name "release" for the operation we call "detach". Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete). This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release". BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002 Review URL: https://codereview.chromium.org/1809733002
* Assert when running SampleApp with msaa 16 on Windows 10Gravatar aleksandar.stojiljkovic2015-11-05
| | | | | | | | | Trivial: skip calling SkWGLExtensions::selectFormat with 0 elements, and handle if called. BUG=4529 Review URL: https://codereview.chromium.org/1427583007
* Start making all .cpp files compile-able on all platforms.Gravatar mtklein2015-11-02
| | | | | | | | | | | | | | | | | | | | | | | I sometimes dream to hone our build process down to something as simple as $ find src -name '*.cpp' | xargs c++ <some cflags> -c -o skia.o To start, it helps if we can compile all files on all platforms. Each non-portable file guards itself with defines provided by SkTypes.h. This does not convert all non-portable code, but it's a good representative chunk. E.g. instead of having to remember which SkDebug_*.cpp to compile on which platform we can just compile all three and let the code itself sort it out. This has the nice side effect of making non-portable code declare the conditions under which it can compile explicitly. I've been testing mostly with the CMake build as it's easiest, but this should apply equally to BUILD, Gyp, and GN files... to any build system really. BUG=skia:4269 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1411283005
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Move SkTemplates.h to private.Gravatar bungeman2015-08-19
| | | | | | | | SkTemplates.h contains a number of Skia specific utilities which are not designed for external use. In addition to reducing the external support burden, this will allow Skia to freely refactor this file. Review URL: https://codereview.chromium.org/1272293004
* Change initializer list order to match field declaration order.Gravatar sammc2015-06-30
| | | | | | BUG=chromium:505304 Review URL: https://codereview.chromium.org/1214933004
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Use IDWriteFontFallback when available.Gravatar bungeman2015-02-23
| | | | | | | This is prefereable to the current IDWriteTextLayout method, but is only available on Windows 8.1 and later. Review URL: https://codereview.chromium.org/942083004
* Implement onMatchFamilyStyleCharacter for DirectWrite.Gravatar bungeman2015-02-20
| | | | Review URL: https://codereview.chromium.org/946603002
* Update DirectWrite streams to SkStreamAsset.Gravatar bungeman2015-02-18
| | | | | | | SkTypefaces now deal in terms of SkStreamAsset, but the DirectWrite port was never fully converted. Review URL: https://codereview.chromium.org/940563002
* Port SkRefCnt.h to new SkAtomics.hGravatar mtklein2015-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds sk_memory_barrier(), implemented using sk_atomic_fetch_add() on an uninitialized variable. If that becomes a problem we can drop this to the porting layer, using std::atomic_thread_fence() / __atomic_thread_fence() / __sync_synchronize(). The big win is that ref() doesn't generate a memory barrier any more on ARM. This is an instance of SkSafeRef() in SkPaint(const SkPaint&) after this CL: 4d0: 684a ldr r2, [r1, #4] 4d2: 6018 str r0, [r3, #0] 4d4: b13a cbz r2, 4e6 <_ZN7SkPaintC1ERKS_+0x2e> 4d6: 1d10 adds r0, r2, #4 4d8: e850 4f00 ldrex r4, [r0] 4dc: 3401 adds r4, #1 4de: e840 4500 strex r5, r4, [r0] 4e2: 2d00 cmp r5, #0 4e4: d1f8 bne.n 4d8 <_ZN7SkPaintC1ERKS_+0x20> Here's the before, pretty much the same with two memory barriers surrounding the ref(): 4d8: 684a ldr r2, [r1, #4] 4da: 6018 str r0, [r3, #0] 4dc: b15a cbz r2, 4f6 <_ZN7SkPaintC1ERKS_+0x3e> 4de: 1d10 adds r0, r2, #4 4e0: f3bf 8f5f dmb sy 4e4: e850 4f00 ldrex r4, [r0] 4e8: 3401 adds r4, #1 4ea: e840 4500 strex r5, r4, [r0] 4ee: 2d00 cmp r5, #0 4f0: d1f8 bne.n 4e4 <_ZN7SkPaintC1ERKS_+0x2c> 4f2: f3bf 8f5f dmb sy The miscellaneous files in here are just fixups to explicitly include SkMutex.h, instead of leeching it off SkRefCnt.h. No public API changes. TBR=reed@google.com Build trybots seem hosed. NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/896803002
* Fix SkIStream nits.Gravatar bungeman2015-01-22
| | | | | | | | | Fix comment, constness of one field, and delete already checks for NULL. TBR=reed@google.com Trivial change to debatably public api. Review URL: https://codereview.chromium.org/868643003
* Remove staging SkStream::unref().Gravatar bungeman2015-01-22
| | | | | | | | | SkStream::unref() was added to ease transitioning off of SkStream deriving from SkRefCnt. It is no longer needed, remove it. TBR=reed@google.com Review URL: https://codereview.chromium.org/861413002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* namespace {} trick for SK_DECLARE_STATIC_ONCEGravatar mtklein2015-01-13
| | | | | | | | | | | | | | | Like all our other SK_DECLARE_STATIC_*, it's usually not a thread-safe thing to put inside a function. Adding namespace {} prevents that syntactically. Needs https://codereview.chromium.org/841263004/ to land first. BUG=chromium:447890 No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/806473006
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Move WGL header from include to srcGravatar djsollen2014-11-14
| | | | | | NOTRY=true Review URL: https://codereview.chromium.org/728823002
* Detect presence of dwrite_1.h.Gravatar bungeman2014-09-10
| | | | | | | | | | | | | | | | | | This introduces the SK_HAS_DWRITE_1_H define which may be set at build time or will be true when WINVER_MAXVER >= 0x0602 . The dwrite_1.h header is available starting in Windows SDK 8.0. This change supports users who must still use Windows SDK 7.0. It also allows for easier local testing of the older interfaces on newer versions of Windows. See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1053652 R=george@mozilla.com, mtklein@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/552383002
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Require length in sk_wchar_to_string.Gravatar bungeman2014-08-25
| | | | | | | | | | | | | This information is already available at all call sites and allows the call to WideCharToMultiByte to not overwrite the '\0' in the writable_str() which isn't really writable. BUG=skia:1989 R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/500113002
* Explicitly typedef GetUserDefaultLocaleName as WINVER may not be high enough ↵Gravatar george2014-07-30
| | | | | | | | | | when compiling to allow visibility of the function prototype in windows.h R=bungeman@google.com, bungeman1 Author: george@mozilla.com Review URL: https://codereview.chromium.org/422823008
* When performing offscreen rendering on windows, attempt to use a pbuffer ↵Gravatar bsalomon2014-07-01
| | | | | | | | | | | | context. A pbuffer context is less likely to have a blocking SwapBuffers (due to vsync). R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/336863009
* Support using OpenGL ES context on desktopGravatar kkinnunen2014-06-30
| | | | | | | | | | | | | | Support using OpenGL ES context on desktop for unix and Android platforms. This is mainly useful in development. Add --gpuAPI flag to gm, dm, bench, bench_pictures and render_pictures. The possible parameters for the flag are "gl" and "gles". R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/319043005
* Revert of Support using OpenGL ES context on desktop ↵Gravatar rmistry2014-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/319043005/) Reason for revert: Caused segmentation fault on many builders. Please see reverted CL's msg #21 for details. Original issue's description: > Support using OpenGL ES context on desktop > > Support using OpenGL ES context on desktop for unix and Android platforms. This > is mainly useful in development. > > Add --gpuAPI flag to gm, dm, bench, bench_pictures and render_pictures. The > possible parameters for the flag are "gl" and "gles". > > Committed: https://skia.googlesource.com/skia/+/74fc727dc88ee24d89f88cb1709f963e9073aeb3 R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com, kkinnunen@nvidia.com TBR=bsalomon@google.com, kkinnunen@nvidia.com NOTREECHECKS=true NOTRY=true Author: rmistry@google.com Review URL: https://codereview.chromium.org/351583002
* Support using OpenGL ES context on desktopGravatar kkinnunen2014-06-22
| | | | | | | | | | | | | | Support using OpenGL ES context on desktop for unix and Android platforms. This is mainly useful in development. Add --gpuAPI flag to gm, dm, bench, bench_pictures and render_pictures. The possible parameters for the flag are "gl" and "gles". R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/319043005
* Add needed virtual destructors.Gravatar bungeman2014-06-19
| | | | | | | | | | These were found by the clang on Windows build. R=mtklein@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/328303005
* Split SkFontHost_win_dw.Gravatar bungeman2014-06-05
| | | | | | | | | | | | Split SkFontHost_win_dw into FontMgr, Typeface, and ScalerContext. This makes working on these files easier, and moves away from the legacy FontHost naming. R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/314193002
* Clean up SkOnce:Gravatar mtklein2014-06-02
| | | | | | | | | | | | | | | | 1 Remove atExit feature: clients can do it just as well as SkOnce can. 2 Remove support for functors: no one but the unit test did that. 3 Remove support for unused non-static SkOnceFlag (no SK_ONCE_INIT). 4 Add SkOnce variants for no-arg functions so we're not forced to pass dummy values all the time. 5 Merge SkSpinlock and SkOnceFlag, making all members private. 6 More notes about memory barriers, adding an acquire load after acquiring the spinlock. BUG=skia: R=bungeman@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/302083003
* Fix undefined behavior in DirectWrite GDI compatible metrics.Gravatar bungeman@google.com2014-05-21
| | | | | | | | | | | | | GetGdiCompatibleGlyphMetrics checks the matrix passed to it. If the matrix has any NaNs or INFs or otherwise looks bad, it returns E_INVALIDARG and so the advances will be zero. BUG=skia:2579 R=reed@google.com Review URL: https://codereview.chromium.org/298863002 git-svn-id: http://skia.googlecode.com/svn/trunk@14829 2bbb7eff-a529-9590-31e7-b0007b416f81
* A remotable font management interface and DirectWrite implementation.Gravatar bungeman@google.com2014-03-21
| | | | | | | | | | | | The introduced SkRemotableFontMgr is a font management interface designed for simple and fast proxy support. SkFontMgr_Indirect bridges a SkRemotableFontMgr and a local SkFontMgr to present a SkFontMgr interface. This change is to be followed by https://codereview.chromium.org/132113015/ and https://codereview.chromium.org/206693003 . R=reed@google.com Review URL: https://codereview.chromium.org/206683002 git-svn-id: http://skia.googlecode.com/svn/trunk@13897 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixed cross compilation with mingw.Gravatar commit-bot@chromium.org2014-03-19
| | | | | | | | | | | | | | | | | | | | | Tested in Mozilla source tree. I tried to use skia build system, but it's up to the task for cross compilation. SkHRESULT.cpp - Use proper file name (that matters on case sensitive OSes) SkAtomics_win.h - Don't use pragma intrinsic on GCC (this causes massive warnings) SkOSFile_win.cpp - This one is tricky. GCC doesn't allow (void*) casts in template argument constants and INVALID_HANDLE_VALUE looks like this: ((HANDLE)(LONG_PTR)-1) where HANDLE is typedefed to void*. Changed the code to use LONG_PTR as template argument and cast it when needed. BUG=skia: R=bungeman@google.com, reed@google.com Author: cjacek@gmail.com Review URL: https://codereview.chromium.org/198643004 git-svn-id: http://skia.googlecode.com/svn/trunk@13862 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
* 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
* 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
* Minor changes to XPS device.Gravatar bungeman@google.com2013-10-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11552 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkImageDecoders to take an SkStreamRewindable.Gravatar scroggo@google.com2013-09-25
| | | | | | | | | | | | | | | | | | | | Only affects factories, static functions that will use the factories, and subset decoding, which all require rewinding. The decoders themselves continue to take an SkStream. This is merely documentation stating which functions will possibly rewind the passed in SkStream. This is part of the general change to coordinate SkStreams with Android's streams, which don't necessarily support rewinding in all cases. Update callers to use SkStreamRewindable. BUG=skia:1572 R=bungeman@google.com, reed@google.com Review URL: https://codereview.chromium.org/23477009 git-svn-id: http://skia.googlecode.com/svn/trunk@11460 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rip out CSAA supportGravatar commit-bot@chromium.org2013-09-06
| | | | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23882009 git-svn-id: http://skia.googlecode.com/svn/trunk@11138 2bbb7eff-a529-9590-31e7-b0007b416f81
* My clang now doesn't complain about !"foo".Gravatar mtklein@google.com2013-08-22
| | | | | | | | | BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/22875037 git-svn-id: http://skia.googlecode.com/svn/trunk@10874 2bbb7eff-a529-9590-31e7-b0007b416f81
* set nominmax on windowsGravatar bsalomon@google.com2013-07-31
| | | | | | | | R=scroggo@google.com Review URL: https://codereview.chromium.org/20990007 git-svn-id: http://skia.googlecode.com/svn/trunk@10470 2bbb7eff-a529-9590-31e7-b0007b416f81
* This reverts commit 4052fd051db67bd1099fde2c4fe400cfbe1f2426.Gravatar bsalomon@google.com2013-07-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10374 2bbb7eff-a529-9590-31e7-b0007b416f81
* R=borenet@google.com, bungeman@google.com, robertphillips@google.comGravatar commit-bot@chromium.org2013-07-25
| | | | | | | | Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/19862002 git-svn-id: http://skia.googlecode.com/svn/trunk@10372 2bbb7eff-a529-9590-31e7-b0007b416f81
* Clean up a few warnings on Windows x64.Gravatar bungeman@google.com2013-07-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10233 2bbb7eff-a529-9590-31e7-b0007b416f81