Commit Graph

127 Commits

Author SHA1 Message Date
Brian Salomon
0c26a9dbd0 GR_TEST_UTILS fixes
Fixes build of Skia lib when GR_TEST_UTILS=0

Makes GR_TEST_UTILS=0 for official builds

Makes "Mini" builder bot exercise building GPU with is_official_build=true

Bug: skia:6786
Change-Id: I6186683a3a216d2e779645bd9e8276a66bcff4d5
Reviewed-on: https://skia-review.googlesource.com/21524
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-07-06 14:35:45 +00:00
Cary Clark
a9d9ab3683 fix SkASSERT for Visual Studio
Changing colons to parens permits
the error to be recognized, so that
clicking on it goes to the source
line with the assert.

R=reed@google.com

Change-Id: Ifec7fc0633e8ecf0f670418fefaf8ca87ee3d498
Reviewed-on: https://skia-review.googlesource.com/16485
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-05-11 13:48:17 +00:00
Mike Reed
a9e241d357 drawfilter is legacy-guarded, no need for deprecated
Bug: skia:
Change-Id: Ic8dbe9aa043bd793e49975f5b6f08a0ac38e4faa
Reviewed-on: https://skia-review.googlesource.com/15185
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-05-03 15:46:55 +00:00
herb
12ae597ef5 Use alignas to force alignment.
Using alignas reduces code and platform specific macros.

Use alignas instead of std::aligned_storage because it is unimplemneted
in MSVC 2015.

Here is the bug from MS:
https://connect.microsoft.com/VisualStudio/feedback/details/1559873/std-aligned-storage-cannot-align-type-with-16-byte

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2473143002
2016-11-04 08:41:01 -07:00
benjaminwagner
dc46bf10ae Revert of Try to use only std::aligned_storage. (patchset #2 id:20001 of https://codereview.chromium.org/2468243002/ )
Reason for revert:
DM failure: https://luci-milo.appspot.com/swarming/task/324387bf30100f10

c:\b\work\skia\src\core\sklinearbitmappipeline.cpp:49: fatal error: "assert(sizeof(Variant) <= sizeof(fSpace))"

Original issue's description:
> Try to use only std::aligned_storage. This does not change the API.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/e736e0c2d52a29a3b88a29ab39b3a90a5a2443a0

TBR=mtklein@chromium.org,bsalomon@google.com,mtklein@google.com,reed@google.com,herb@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2474073002
2016-11-03 08:08:23 -07:00
herb
e736e0c2d5 Try to use only std::aligned_storage. This does not change the API.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2468243002
2016-11-03 07:34:15 -07:00
halcanary
4871f22777 SkPDF: Glyph validation change
Instead of mapping invaid glyphIDs to zero or maxGlyphID,
don't draw them at all.

Validate glyphs when glyph is written, not ahead of time.

Don't allocate array to copy user-provided glyphs.

Easy early exit from SkPDFDevice::internalDrawText()
    GlyphPositioner::flush() called ~GlyphPositioner()
    SkScopeExit class now exists.

Assume SkTypeface* pointers are now never null in more
places.

precalculate alignmentFactor to clean up code.

SkPDFDevice::updateFont must be called with validated
glyphID.  Skip bad glyphs to make this true.

SkPDFDevice::updateFont always succeeds.

SkPDFFont::GetFontResource always succeeds (preconditions are
asserted).  If GetMetrics fails, don't call GetFontResource.

SkPDFFont::glyphsToPDFFontEncodingCount() becomes
SkPDFFont::countStretch() and is inlined.

SkPDFFont::glyphsToPDFFontEncoding now works one Glyph at a
time and is inlined.

SkPDFFont::noteGlyphUsage() operates one glyph at a time.

Add SkScopeExit.h; also a unit test for it.

SkPostConfig: Fix SK_UNUSED for Win32.

No public API changes.
TBR=reed@google.com

BUG=625995

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2278703002

Review-Url: https://codereview.chromium.org/2278703002
2016-08-26 13:17:44 -07:00
msarett
fbfa258027 Optimized implementation of quickReject()
Impl Overview
(1) Keep the device clip bounds up to date.  This
    requires minimal additional work in a few places
    throughout canvas.
(2) Keep track of if the ctm isScaleTranslate.  Yes,
    there's a function that does this, but it's slow
    to call.
(3) Perform the src->device transform in quick reject,
    then check intersection/nan.

Other Notes:
(1) NaN and intersection checks are performed
    simultaneously.
(2) We no longer quick reject infinity.
(3) Affine and perspective are both handled in the slow
    case.
(4) SkRasterClip::isEmpty() is handled by the intersection
    check.

Performance on Nexus 6P:
93.2ms -> 59.8ms

Overall Android Jank Tests Performance Impact:
Should gain us a ms or two on some tests.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002

Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da
Review-Url: https://codereview.chromium.org/2225393002
2016-08-12 08:29:08 -07:00
mtklein
5aeb2fa253 Revert of Optimized implementation of quickReject() (patchset #12 id:260001 of https://codereview.chromium.org/2225393002/ )
Reason for revert:
New assert triggering in the Chrome roll,
https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/208750/steps/webkit_unit_tests%20%28with%20patch%29%20on%20Ubuntu-12.04/logs/FrameThrottlingTest.SynchronousLayoutInAnimationFrameCallback

and breaks the SKNX_NO_SIMD bot,
https://codereview.chromium.org/2236363004

Original issue's description:
> Optimized implementation of quickReject()
>
> Impl Overview
> (1) Keep the device clip bounds up to date.  This
>     requires minimal additional work in a few places
>     throughout canvas.
> (2) Keep track of if the ctm isScaleTranslate.  Yes,
>     there's a function that does this, but it's slow
>     to call.
> (3) Perform the src->device transform in quick reject,
>     then check intersection/nan.
>
> Other Notes:
> (1) NaN and intersection checks are performed
>     simultaneously.
> (2) We no longer quick reject infinity.
> (3) Affine and perspective are both handled in the slow
>     case.
> (4) SkRasterClip::isEmpty() is handled by the intersection
>     check.
>
> Performance on Nexus 6P:
> 93.2ms -> 59.8ms
>
> Overall Android Jank Tests Performance Impact:
> Should gain us a ms or two on some tests.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002
>
> Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da

TBR=reed@google.com,herb@google.com,msarett@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2231393003
2016-08-12 02:22:33 -07:00
msarett
d22a817ff5 Optimized implementation of quickReject()
Impl Overview
(1) Keep the device clip bounds up to date.  This
    requires minimal additional work in a few places
    throughout canvas.
(2) Keep track of if the ctm isScaleTranslate.  Yes,
    there's a function that does this, but it's slow
    to call.
(3) Perform the src->device transform in quick reject,
    then check intersection/nan.

Other Notes:
(1) NaN and intersection checks are performed
    simultaneously.
(2) We no longer quick reject infinity.
(3) Affine and perspective are both handled in the slow
    case.
(4) SkRasterClip::isEmpty() is handled by the intersection
    check.

Performance on Nexus 6P:
93.2ms -> 59.8ms

Overall Android Jank Tests Performance Impact:
Should gain us a ms or two on some tests.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002

Review-Url: https://codereview.chromium.org/2225393002
2016-08-11 14:40:04 -07:00
djsollen
300405a7a2 Enable SK_DEBUG/SK_RELEASE to be defined in the user config.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2204683005

Review-Url: https://codereview.chromium.org/2204683005
2016-08-05 13:04:41 -07:00
mtklein
8d7f5c3f29 Default fake gamma to sRGB.
No one appears to be using the default 2.2.
This makes SK_GAMMA_SRGB the default / a no-op, which seems more realistic.

Chrome's explicitly setting SK_GAMMA_EXPONENT or SK_GAMMA_SRGB.
We set Android platform explicitly to 1.4.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2198073002

Review-Url: https://codereview.chromium.org/2198073002
2016-08-01 09:22:12 -07:00
bungeman
1f790aaeef Improve assert reporting.
Make SkASSERTF output readable.
Ensure the assert predicate is stringified once.
Make the abort code consistent.

TBR=reed
This doesn't change any public API, most of this should be privatized.

Review-Url: https://codereview.chromium.org/2161103002
2016-07-20 09:49:10 -07:00
mtklein
e5fb9c8079 centralize VECTORCALL as SK_VECTORCALL
Gonna start using this, might as well define it once centrally.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2126253002

No public API changes.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2126253002
2016-07-07 08:12:09 -07:00
halcanary
4dbbd04314 SkLeanWindows.h: #include "Windows.h" fewer places
$ 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
2016-06-07 17:21:10 -07:00
ericrk
983294f78f Skia Filter Quality and Scaling Metrics
Adds histogram metrics to log the filter quality and scale factor of
each image draw. To make the data easier to consume, this is broken
down into a number of individual histograms:
- Filter quality across all draw calls
- Scale amount across all draw calls
- Scale amount per filter quality (4 histograms total)

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686203002

Committed: https://skia.googlesource.com/skia/+/f57b3a6e4a002caf01378832cbd756c6c163a783

Review URL: https://codereview.chromium.org/1686203002
2016-04-18 09:14:00 -07:00
ericrk
82e26bf239 Revert of Skia Filter Quality and Scaling Metrics (patchset #3 id:60001 of https://codereview.chromium.org/1686203002/ )
Reason for revert:
reverting this to address Ilya's comments.

Original issue's description:
> Skia Filter Quality and Scaling Metrics
>
> Adds histogram metrics to log the filter quality and scale factor of
> each image draw. To make the data easier to consume, this is broken
> down into a number of individual histograms:
> - Filter quality across all draw calls
> - Scale amount across all draw calls
> - Scale amount per filter quality (4 histograms total)
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686203002
>
> Committed: https://skia.googlesource.com/skia/+/f57b3a6e4a002caf01378832cbd756c6c163a783

TBR=bsalomon@google.com,isherman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1735423002
2016-02-25 22:15:29 -08:00
ericrk
f57b3a6e4a Skia Filter Quality and Scaling Metrics
Adds histogram metrics to log the filter quality and scale factor of
each image draw. To make the data easier to consume, this is broken
down into a number of individual histograms:
- Filter quality across all draw calls
- Scale amount across all draw calls
- Scale amount per filter quality (4 histograms total)

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686203002

Review URL: https://codereview.chromium.org/1686203002
2016-02-25 11:21:57 -08:00
ericrk
369e9375a3 Add Histogram Macros to Skia
Adds a set of histogram macros to Skia, modeled after Chrome's
UMA_HISTOGRAM_* macros. These allow logging of high frequency events,
and are useful to analyze real world usage of certain features.

By default, these macros are no-ops. Users can provide a custom
header file which defines these macros if they wish to collect
histogram data. Chrome will provide such a header.

I've currently only added two macros:
- SK_HISTOGRAM_BOOLEAN - logs a true/false type relationship (whether
we are tiling a texture or not on each draw).
- SK_HISTOGRAM_ENUMERATION - logs a set of potential values (which of
a number of choices were selected for the texture upload path).

We could add more unused macros at the moment, but it seems easier to
add these as needed, WDYT?

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1652053004

Review URL: https://codereview.chromium.org/1652053004
2016-02-05 15:32:36 -08:00
djsollen
f2b340fc88 Consolidate SK_CRASH and sk_throw into SK_ABORT
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1648343003

Review URL: https://codereview.chromium.org/1648343003
2016-01-29 08:51:04 -08:00
djsollen
aa97a84404 Revert of Consolidate SK_CRASH and sk_throw into SK_ABORT (patchset #5 id:80001 of https://codereview.chromium.org/1610823002/ )
Reason for revert:
Chrome is calling SK_CRASH

Original issue's description:
> Consolidate SK_CRASH and sk_throw into SK_ABORT
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1610823002
>
> Committed: https://skia.googlesource.com/skia/+/4c5cd7d527ed29aabfa72aa47b23a4496eeda357

TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1620333002
2016-01-22 06:50:25 -08:00
djsollen
4c5cd7d527 Consolidate SK_CRASH and sk_throw into SK_ABORT
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1610823002

Review URL: https://codereview.chromium.org/1610823002
2016-01-22 06:04:55 -08:00
mtklein
defa0daa6a Clean up SkXfermode_opts.h
It seems that MSVC + __vectorcall don't play well together,
so back ourselves out into a situation where we don't need it.

   - Inline transfermode functions.  This removes the need for SK_VECTORCALL.
   - Remove 565 destination specializations.
     Blending into 565 is not speed-critical enough to merit the code bloat.
   - Removing 565 specializations means a bunch of Sk4px code is now dead.

8888 xfermodes generally speed up a bit from inlining, smoothly ranging from no change down to 0.65x for the fastest functions like Plus or Modulate.

565 xfermodes generally slow down because we're doing 565 -> 8888 and 8888->565 conversion serially[1] and using the stack, smoothly ranging from no change up to 2x slower for the fastest functions like Plus and Modulate.

[1] the 565->8888 conversion is actually being autovectorized

BUG=skia:4765,skia:4776
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1565223002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1565223002
2016-01-08 11:45:21 -08:00
benjaminwagner
58afee8220 Fix GOOGLE3 Android build.
DebugWriteToStderr isn't defined for Android. I'm not sure if I just didn't test compiling for Android or if this is due to a change in the base library.

BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1438773003
2015-11-18 13:14:14 -08:00
mtklein
14102ca4cf __vectorcall needs SSE
We don't have builders in this mode, but Mozilla does.

BUG=skia:4563

TBR=reed@google.com
No public API changes.

Review URL: https://codereview.chromium.org/1445283002
2015-11-16 16:20:29 -08:00
benjaminwagner
8a3760f8b2 For BUILD.public, let SkPreConfig.h set SK_RELEASE based on NDEBUG.
Use DumpStackTrace in SkASSERT in GOOGLE3.

There are extra assertions enabled in debug mode that cause RecordDraw_TextBounds to fail.

New include causes a naming conflict with global name "base".

Corresponding internal cl/106495354

No public API changes.

TBR=reed@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1423013004
2015-10-29 13:40:28 -07:00
mtklein
72815e9b15 move reinterpret_cast into SK_PREFETCH
no public API changes
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1419573011
2015-10-28 09:52:20 -07:00
mtklein
6885a1e7c0 Make SK_PREFETCH work on Windows too.
- Use _mm_prefetch() if available, e.g. with MSVC.
- Some other tidying up.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1427663002
2015-10-27 13:06:47 -07:00
mdempsky
106b12427e Remove SkNEW and SkDELETE macros
This CL removes the uses of SkNEW that have resprouted since commit
385fe4d, and removes the macros entirely now that Android and Chromium
have been cleaned up to no longer depend on them.

A bunch of files implicitly depend on #include <new> from SkPostConfig.h
still though, so keep that for now.  To be fixed in a followup CL.

[mtklein mucking around]
Only public API removed.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1360653004
2015-09-22 06:10:35 -07:00
bungeman
f3c15b7cfc Move SkTemplates.h to private.
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
2015-08-19 11:56:48 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of https://codereview.chromium.org/1265033002/ )
Reason for revert:
revert to unblock DEPS roll

../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath'
  SkPath base_path;

Original issue's description:
> IWYU: 'core' target, files starting A-C.
>
> TBR=reed@google.com
> Verbal lgtm, does not change API.
>
> Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

TBR=reed@google.com,mtklein@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1273613002
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
bungeman
f20488b4f2 Clean up a few includes, introduce iwyu.
The current include-what-you-use with current clang is much less
noisy and more useful than it has been in the past. This change
introduces a few IWYU directives (which are helpful documentation for
humans as well) and fixes a few sets of includes.

Review URL: https://codereview.chromium.org/1207893002
2015-07-29 11:49:40 -07:00
mtklein
cd1930d4f1 De-templatize Sk4pxXfermode code a bit.
This deduplicates a few pieces of code:
  - we end up with one copy of each xfer32() driver loop instead of one per xfermode;
  - we end up with two* copies of each xfermode implementation instead of ten**.

* For a given Mode: Mode() itself and xfer_aa<Mode>().
** From unrolling: twice at a stride of 8, once at 4, once at 2, and once at 1, then all again for when we have AA.

This decreases the size of SkXfermode.o from 1.5M to 620K on x86-64 and from 1.3M to 680K on ARMv7+NEON.

If we wanted to, we could eliminate the xfer_aa<Mode>() copy by tagging each Mode() function as __attribute__((noinline)) or its equivalent.  This would result in another ~100K space savings.

Performance is affected in proportion to the original xfermode speed:
fast modes like Plus take the largest proportional hit, and slow modes
like HardLight or SoftLight see essentially no hit at all.

This adds SK_VECTORCALL to help keep this code fast on ARMv7 and Windows.  I've looked at the ARMv7 generated code... it looks good, even pretty.

For compatibility with SK_VECTORCALL, we now pass the vector-sized arguments by value instead of by reference.  Some refactoring now allows us to declare each mode as just a static function instead of a struct, which simplifies things.

TBR=reed@google.com
No public API changes.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/e617e1525916d7ee684142728c0905828caf49da

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon-Trybot

Review URL: https://codereview.chromium.org/1242743004
2015-07-21 12:39:57 -07:00
mtklein
654ad19fbd Revert of De-templatize Sk4pxXfermode code a bit. (patchset #2 id:20001 of https://codereview.chromium.org/1242743004/)
Reason for revert:
http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon/builds/1168/steps/build%20most/logs/stdio

Original issue's description:
> De-templatize Sk4pxXfermode code a bit.
>
> This deduplicates a few pieces of code:
>   - we end up with one copy of each xfer32() driver loop instead of one per xfermode;
>   - we end up with two* copies of each xfermode implementation instead of ten**.
>
> * For a given Mode: Mode() itself and xfer_aa<Mode>().
> ** From unrolling: twice at a stride of 8, once at 4, once at 2, and once at 1, then all again for when we have AA.
>
> This decreases the size of SkXfermode.o from 1.5M to 620K on x86-64 and from 1.3M to 680K on ARMv7+NEON.
>
> If we wanted to, we could eliminate the xfer_aa<Mode>() copy by tagging each Mode() function as __attribute__((noinline)) or its equivalent.  This would result in another ~100K space savings.
>
> Performance is affected in proportion to the original xfermode speed:
> fast modes like Plus take the largest proportional hit, and slow modes
> like HardLight or SoftLight see essentially no hit at all.
>
> This adds SK_VECTORCALL to help keep this code fast on ARMv7 and Windows.  I've looked at the ARMv7 generated code... it looks good, even pretty.
>
> For compatibility with SK_VECTORCALL, we now pass the vector-sized arguments by value instead of by reference.  Some refactoring now allows us to declare each mode as just a static function instead of a struct, which simplifies things.
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e617e1525916d7ee684142728c0905828caf49da

TBR=msarett@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1245273005
2015-07-21 12:08:41 -07:00
mtklein
e617e15259 De-templatize Sk4pxXfermode code a bit.
This deduplicates a few pieces of code:
  - we end up with one copy of each xfer32() driver loop instead of one per xfermode;
  - we end up with two* copies of each xfermode implementation instead of ten**.

* For a given Mode: Mode() itself and xfer_aa<Mode>().
** From unrolling: twice at a stride of 8, once at 4, once at 2, and once at 1, then all again for when we have AA.

This decreases the size of SkXfermode.o from 1.5M to 620K on x86-64 and from 1.3M to 680K on ARMv7+NEON.

If we wanted to, we could eliminate the xfer_aa<Mode>() copy by tagging each Mode() function as __attribute__((noinline)) or its equivalent.  This would result in another ~100K space savings.

Performance is affected in proportion to the original xfermode speed:
fast modes like Plus take the largest proportional hit, and slow modes
like HardLight or SoftLight see essentially no hit at all.

This adds SK_VECTORCALL to help keep this code fast on ARMv7 and Windows.  I've looked at the ARMv7 generated code... it looks good, even pretty.

For compatibility with SK_VECTORCALL, we now pass the vector-sized arguments by value instead of by reference.  Some refactoring now allows us to declare each mode as just a static function instead of a struct, which simplifies things.

TBR=reed@google.com
No public API changes.

BUG=skia:

Review URL: https://codereview.chromium.org/1242743004
2015-07-21 12:03:37 -07:00
mtklein
2766c00fc0 remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
2015-06-26 11:45:03 -07:00
mtklein
519580553a Use SkMScalar as float by default to match Chromium.
Tweak some test values to pass with floats.

As expected, this regresses matrix44_setconcat_general by about 2x.

BUG=skia:

Review URL: https://codereview.chromium.org/1169813006
2015-06-09 15:06:22 -07:00
joshualitt
3f655f34a2 Initial CL to create GrBatchTest infrastructure
BUG=skia:

Review URL: https://codereview.chromium.org/1109153004
2015-04-29 10:01:22 -07:00
borenet
4808757d7a Remove all code related to NaCl
BUG=skia:3600
DOCS_PREVIEW= https://skia.org/?cl=1036283002

Review URL: https://codereview.chromium.org/1036283002
2015-04-02 12:16:36 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
bungeman
d709ea8d14 Remove SkLONGLONG.
All users now define SkLONGLONG.
This fixes a long outstanding TODO now that int64_t is required.

BUG=skia:179

Review URL: https://codereview.chromium.org/1000933003
2015-03-17 07:23:39 -07:00
mtklein
e76161458a Spin off some fixes to land right away.
BUG=skia:

Review URL: https://codereview.chromium.org/960023002
2015-02-26 10:14:15 -08:00
djsollen
7ff705023d Enable override keyword for GCC versions >= 4.7
Review URL: https://codereview.chromium.org/945803005
2015-02-20 12:35:37 -08:00
mtklein
1e4e814c03 SK_NO_FLATE
Also remove skia_zlib_static.  We're not using it.  We don't even have zlib in DEPS.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/936583002
2015-02-17 13:10:43 -08:00
mtklein
1b9c8bb0a1 Only instance-count in SK_DEVELOPER builds (our debug builds, not Chrome's)
BUG=skia:

Review URL: https://codereview.chromium.org/910973003
2015-02-10 06:14:05 -08:00
mtklein
a64c48f4f9 Move sync code to include/, switch from using platform define to a proxy header in core/
This fixes two problems:
  1)  #include SK_SOME_DEFINE doesn't work well for all our clients.
  2)  Things in include/ are #including things in src/, which we don't like.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/862983002
2015-01-21 13:13:31 -08:00
bungeman
8dfdfff98d Don't use 'defined' in macro expansion.
A careful reading of the preprocessor specification indicates that
any use of the 'defined' operator outside the form of 'defined X' or
'defined ( X )' directly in the constant expression of a '#if' or
'#elif' may cause undefined behavior.

In particular, msvc is very unpredictable. The 'defined X' and
'defined ( X )' forms behave differently when created from marco
expansion, with 'defined ( X )' generally evaluating to '0L'. The
'defined X' form generally behaves more the way one would expect,
but still has a number of quirks which should simply be considered
undefined behavior.

BUG=chromium:419245

Review URL: https://codereview.chromium.org/657183002
2014-10-15 13:53:55 -07:00
derekf
29dda80c01 Add support for EGL on linux
Allow setting skia_egl=1 to build skia against EGL instead of GLX on unix

Review URL: https://codereview.chromium.org/604853003
2014-10-01 10:52:52 -07:00