Commit Graph

116 Commits

Author SHA1 Message Date
digit@google.com
1771cbf43d posix: Avoid static initializers in static/global mutexes
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
2012-01-26 21:26:40 +00:00
senorblanco@chromium.org
e50f7361b4 Add a wide stroked line path benchmark to bench. It uses the same stroke width
and endcap style as the stroked curved path.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@3028 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-01-12 19:10:35 +00:00
bsalomon@google.com
cadbcb8e53 Towards enabling -Werror in skia on Linux
Review URL: http://codereview.appspot.com/5516044/



git-svn-id: http://skia.googlecode.com/svn/trunk@2983 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-01-06 19:22:11 +00:00
bsalomon@google.com
508824bd4b Make null gl a top level config in bench
Review URL: http://codereview.appspot.com/5484052/



git-svn-id: http://skia.googlecode.com/svn/trunk@2867 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-12-13 16:49:49 +00:00
reed@google.com
5ae777dcad rename sk_float_isNaN to sk_float_isnan to match related functions
add sk_float_isinf returning non-zero if the argument is +/- infinity



git-svn-id: http://skia.googlecode.com/svn/trunk@2813 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-12-06 20:18:05 +00:00
reed@google.com
1607863b60 rename hasValidCoordinates to isFinite (on SkRect) and reimplement for speed
git-svn-id: http://skia.googlecode.com/svn/trunk@2811 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-12-06 18:56:37 +00:00
reed@google.com
0be5eb7533 add bench for computing isfinite of 4 values (targeted for SkRect)
git-svn-id: http://skia.googlecode.com/svn/trunk@2805 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-12-05 21:53:22 +00:00
reed@google.com
a069c8ff9a speedup AAClip::setRegion (n^2 to n)
add bench for setRegion



git-svn-id: http://skia.googlecode.com/svn/trunk@2759 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-28 19:54:56 +00:00
reed@google.com
055af884c8 add test for drawPosText, to measure any difference it introduces given that
it has to transform each char's position (unlike drawText)



git-svn-id: http://skia.googlecode.com/svn/trunk@2742 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-23 15:52:02 +00:00
tomhudson@google.com
8caac6447d Add fractional-radius blurs to blur benchmark.
Specialize loops in apply_kernel and apply_kernel_interp,
improving blur benchmark performance by 25%.



git-svn-id: http://skia.googlecode.com/svn/trunk@2731 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-22 15:58:06 +00:00
reed@google.com
cc58651183 add bench for shader+blitMask
git-svn-id: http://skia.googlecode.com/svn/trunk@2685 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-15 15:29:45 +00:00
tomhudson@google.com
410e9dc9aa New SkMutex benchmark - used when we suspected mutex performance issues;
committed not because they're a bottleneck now but because we might do
something with them in the future & it's quite lightweight.



git-svn-id: http://skia.googlecode.com/svn/trunk@2675 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-14 17:30:08 +00:00
bsalomon@google.com
3d3dfe011c Fixes int to scalar warnings. This checkin changes the range of random matrix values in a benchmark but it is believed not to affect the runtime.
Review URL: http://codereview.appspot.com/5371045/


git-svn-id: http://skia.googlecode.com/svn/trunk@2653 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-10 13:50:19 +00:00
reed@google.com
073c90769e use new PurgeFontCache() api
git-svn-id: http://skia.googlecode.com/svn/trunk@2633 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-08 20:03:48 +00:00
djsollen@google.com
56c69773ae Update files to use SK_BUILD_FOR_ANDROID.
This CL also removes any unecessary references to
the ANDROID definition.
Review URL: http://codereview.appspot.com/5354049

git-svn-id: http://skia.googlecode.com/svn/trunk@2629 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-08 19:00:26 +00:00
bsalomon@google.com
c436499622 [GPU] Add explicit byte order and PM vs. UPM 8888 configs
Review URL: http://codereview.appspot.com/5347042/



git-svn-id: http://skia.googlecode.com/svn/trunk@2618 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-07 15:54:49 +00:00
bsalomon@google.com
e269f210bd Recommit r2611 with fix for gm
git-svn-id: http://skia.googlecode.com/svn/trunk@2614 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-07 13:29:52 +00:00
bsalomon@google.com
b87d2b5c2a Revert r2611 until windows gm can be debugged
git-svn-id: http://skia.googlecode.com/svn/trunk@2612 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-07 01:58:39 +00:00
bsalomon@google.com
6d9adaec78 Add replacement APIs for createPlatformSurface: createPlatformTexture and createPlatformRenderTarget
git-svn-id: http://skia.googlecode.com/svn/trunk@2611 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-07 01:37:22 +00:00
reed@google.com
8e372c98bf custom memset32 to speed up erasing the offscreen when its width is small.
git-svn-id: http://skia.googlecode.com/svn/trunk@2594 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-03 13:45:38 +00:00
djsollen@google.com
58629291bc Adding support to trunk for building Skia using the Android NDK.
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
2011-11-03 13:08:29 +00:00
reed@google.com
6e5a45c038 add bench for building the font cache
git-svn-id: http://skia.googlecode.com/svn/trunk@2590 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-11-02 21:02:57 +00:00
reed@google.com
1a7eabc8dc support multiple (OR'd) -match parameters
git-svn-id: http://skia.googlecode.com/svn/trunk@2568 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-31 16:33:52 +00:00
reed@google.com
57c4957604 add bench for building aaclips
git-svn-id: http://skia.googlecode.com/svn/trunk@2565 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-31 14:33:35 +00:00
bsalomon@google.com
4a018bb20b Fix pure virtual call from destructor and turn VertBench back on
git-svn-id: http://skia.googlecode.com/svn/trunk@2556 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-28 19:50:21 +00:00
reed@google.com
7b1ca8c66e disable for now (brian is fixing)
git-svn-id: http://skia.googlecode.com/svn/trunk@2555 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-28 19:24:58 +00:00
reed@google.com
05d63aef00 add initial bench for drawVertices
git-svn-id: http://skia.googlecode.com/svn/trunk@2553 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-28 18:57:32 +00:00
tomhudson@google.com
ca529d303e In debug builds, only run each benchmark 1 time (test for assertion-breakage,
not performance).
codereview.appspot.com/5314064/



git-svn-id: http://skia.googlecode.com/svn/trunk@2552 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-28 15:34:49 +00:00
tomhudson@google.com
8382394bf2 Instead of using fixed size for GPU context in benchmain, walk list of
benchmarks and find the largest size required.
codereview.appspot.com/5330045/



git-svn-id: http://skia.googlecode.com/svn/trunk@2551 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-28 14:59:07 +00:00
bsalomon@google.com
74913722bf Add NULL GL context implementation. Use in bench (-nullgl) and SampleApp (backspace key)
Review URL: http://codereview.appspot.com/5303080/


git-svn-id: http://skia.googlecode.com/svn/trunk@2545 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-27 20:44:19 +00:00
tomhudson@google.com
71dd3e0359 New benchmark for blitRect based on call frequency observed while scrolling
Gmail inside Chrome. Is a bit slow...



git-svn-id: http://skia.googlecode.com/svn/trunk@2540 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-27 13:27:20 +00:00
bsalomon@google.com
820e80ad63 Fix some warnings on VS2010
Review URL: http://codereview.appspot.com/5312051/



git-svn-id: http://skia.googlecode.com/svn/trunk@2520 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-24 21:09:40 +00:00
bungeman@google.com
c961442926 Fix wall clock in bench system timer on Windows.
git-svn-id: http://skia.googlecode.com/svn/trunk@2503 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-19 22:10:21 +00:00
bsalomon@google.com
ba3664285b Pass NULL to BenchTimer cons when gl context creation failed.
git-svn-id: http://skia.googlecode.com/svn/trunk@2501 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-19 21:02:27 +00:00
bsalomon@google.com
788e247484 Fix benchmain to build w/ scalar=fixed
git-svn-id: http://skia.googlecode.com/svn/trunk@2500 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-19 20:56:30 +00:00
bsalomon@google.com
373a6635b7 Virtualize SkGLContext with subclasses SkNativeGLContext and SkMesaGLContext, allow both in gm
Review URL: http://codereview.appspot.com/5307045/



git-svn-id: http://skia.googlecode.com/svn/trunk@2499 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-19 20:43:20 +00:00
reed@google.com
095186a466 change text bench to measure text blit speed
git-svn-id: http://skia.googlecode.com/svn/trunk@2483 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-18 12:21:50 +00:00
bsalomon@google.com
e295313f01 move utils/SkEGLContext to gpu/SkGLContext, some gpu.gyp cleanup, set eol style LF on all gpu files
Review URL: http://codereview.appspot.com/5242056/



git-svn-id: http://skia.googlecode.com/svn/trunk@2474 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-13 13:33:08 +00:00
reed@google.com
e05cc8e94e explicitly set opt level for mac-release
delete obsolete FPS bench



git-svn-id: http://skia.googlecode.com/svn/trunk@2442 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-10 14:19:40 +00:00
bungeman@google.com
a38c819b76 Fix two warnings in bench timers.
http://codereview.appspot.com/5164049/


git-svn-id: http://skia.googlecode.com/svn/trunk@2400 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-10-03 20:44:39 +00:00
tomhudson@google.com
5ea050f662 Optimize software radial gradients (remove branches from the inner loop where
we can, because an entire row is conservatively either outside or inside the
gradient.) Change the gradient benchmark to capture both cases, and add new
gm to detect errors in these optimized paths.



git-svn-id: http://skia.googlecode.com/svn/trunk@2327 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-09-26 15:03:55 +00:00
bungeman@google.com
9399cac0a1 Change no-op math bench to noOp.
http://codereview.appspot.com/4962047/


git-svn-id: http://skia.googlecode.com/svn/trunk@2206 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-08-31 19:47:59 +00:00
reed@google.com
ddc518b90f add
git-svn-id: http://skia.googlecode.com/svn/trunk@2185 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-08-29 17:49:23 +00:00
bsalomon@google.com
971d0c8049 Get rid of createRenderTargetFrom3DAPIState and associated glGets necessary to support it.
Review URL: http://codereview.appspot.com/4928041/



git-svn-id: http://skia.googlecode.com/svn/trunk@2144 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-08-19 17:22:05 +00:00
epoger@google.com
3726000a28 More little improvements to bench_graph_svg.py
- add ability to express revision numbers as offset from latest
- add configurable title
Review URL: http://codereview.appspot.com/4808081

git-svn-id: http://skia.googlecode.com/svn/trunk@2067 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-08-08 20:27:04 +00:00
epoger@google.com
c71174da7a Incremental improvements to bench graph generation
- make revision number a link to that change on code.google.com
- clean up display and add help text
- make revision lines show up a bit more (light yellow)
Review URL: http://codereview.appspot.com/4839053

git-svn-id: http://skia.googlecode.com/svn/trunk@2062 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-08-08 17:19:23 +00:00
epoger@google.com
ec3ed6a5eb Automatic update of all copyright notices to reflect new license terms.
I have manually examined all of these diffs and restored a few files that
seem to require manual adjustment.

The following files still need to be modified manually, in a separate CL:

android_sample/SampleApp/AndroidManifest.xml
android_sample/SampleApp/res/layout/layout.xml
android_sample/SampleApp/res/menu/sample.xml
android_sample/SampleApp/res/values/strings.xml
android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java
android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java
experimental/CiCarbonSampleMain.c
experimental/CocoaDebugger/main.m
experimental/FileReaderApp/main.m
experimental/SimpleCocoaApp/main.m
experimental/iOSSampleApp/Shared/SkAlertPrompt.h
experimental/iOSSampleApp/Shared/SkAlertPrompt.m
experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig
gpu/src/android/GrGLDefaultInterface_android.cpp
gyp/common.gypi
gyp_skia
include/ports/SkHarfBuzzFont.h
include/views/SkOSWindow_wxwidgets.h
make.bat
make.py
src/opts/memset.arm.S
src/opts/memset16_neon.S
src/opts/memset32_neon.S
src/opts/opts_check_arm.cpp
src/ports/SkDebug_brew.cpp
src/ports/SkMemory_brew.cpp
src/ports/SkOSFile_brew.cpp
src/ports/SkXMLParser_empty.cpp
src/utils/ios/SkImageDecoder_iOS.mm
src/utils/ios/SkOSFile_iOS.mm
src/utils/ios/SkStream_NSData.mm
tests/FillPathTest.cpp
Review URL: http://codereview.appspot.com/4816058

git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-28 14:26:00 +00:00
reed@google.com
8c4a2db81c fix printf output for name when skscalar is fixed
git-svn-id: http://skia.googlecode.com/svn/trunk@1866 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-14 19:22:19 +00:00
reed@google.com
25df8884bb add bench for building blurs
git-svn-id: http://skia.googlecode.com/svn/trunk@1865 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-14 19:03:58 +00:00
mike@reedtribe.org
63e5e34c4e be sure to call setupPaint, so we can respect the command-line args like alpha
git-svn-id: http://skia.googlecode.com/svn/trunk@1814 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-07-07 01:17:07 +00:00